I have a map which overlays Open Street Map data on imagery for Pennsylvania. As a baselayer to the roads (and eventually other layers) I have two baselayers - Blue Marble NG and USGS EROS 1ft imagery. I would like to be able to combine these two layers into a single base map object that switches automatically as the user zooms in since it makes no sense to view the 1ft imagery for the whole state or the Blue Marble imagery when you are zoomed in.
Ideally I'd like to do this on the client side as I'm pulling the imagery from two different sites.
Answer
- Add 2 base layers to the map
- Subscribe to the map's zoomend event
- Check the zoom level and just switch the base map for your user
Here's a sample page with an event handler for zoomend - http://www.openlayers.org/dev/examples/events.html.
No comments:
Post a Comment