|
From: Jon B. <jon...@go...> - 2011-12-07 11:01:18
|
Hi,
I've got a map with a single WMS layer in EPSG:4326, but the WMS also
supports other projections (say, EPSG:9009130). Is there an way that I can
change the project of the map and the WMS layer on the fly? I'm trying to
do something like (bear in mind I'm using gwt-openlayers):
MapOptions newOptions = new MapOptions();
newOptions.setProjection(srs);
LayerOptions newLayerOptions = new LayerOptions();
newLayerOptions.setProjection(srs);
mapWidget.getMap().setOptions(newOptions);
for (int i = 0; i < mapWidget.getMap().getLayers().length; i++) {
mapWidget.getMap().getLayers()[i].addOptions(newLayerOptions);
}
but this does nothing (no errors, just nothing happens).
Is there a way of just completely destroying the map and reloading it's
contents? I assume this would be quite simple but I've had no luck so far.
Thanks,
Jon
|