Setup
Entities postgis table:
id | name | the_geom | campus_id
1 | bldg_1 | <b1_geom> | 1
2 | bldg_2 | <b2_geom> | 2
3 | bldg_3 | <b3_geom> | 1
4 | bldg_4 | <b4_geom> | 2
I use EPSG:4326 for the entities WMS layer published via Geoserver.
Here campuses 1 and 2 are in two different locations ie,. different bounding boxes.
In the client side, I use OpenLayers(OL) to display the enitities layer over an OL image layer (picture of the campus)
Questions
What would be the best way to switch between these layers in the front-end?
My current solution:- When user chooses a different campus via a combo box, I form a new map object and add the entities layer to it and finally set it up with the bounds corresponding to the chosen campus.
Another requirement in my case is that, one of the campuses is best displayed if it is oriented in the EAST-WEST direction rather than NORTH-SOUTH.
What I have tried:The WMS layers can be rotated to EAST-WEST via the
angle:90
option. Whereas the image layer is not rotated and also the bounds/coordinates of the map layer still remain oriented to NORTH-SOUTH. Thus coordinates got viagetLonLatFromViewPortPx
are not in line with the rotated WMS Layer.One other option I have looked at: Custom CRS But in this the CRS would be applied for all the entities in the table. I want only campus 2 to be oriented in EAST-WEST direction. So a client side solution is most preferred.
Thanks.