[OpenLayers-Users] Re: Displaying Base layers by Zoom Scale
vrbikdan
vrbikdan at gmail.com
Thu Mar 29 02:41:17 EDT 2012
Hi,
I have similar problem. I have OSM base layer from web and a few tiles I
have locally stored in my disc and I want to changed them by zoom. But if I
set min/maxScale, it crasched and any tiles are shown. I don't know, if I
have some mistake in code, or if this is impossible. Here is code:
map = new OpenLayers.Map('mapa',{
controls: [
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.PanPanel(),
new OpenLayers.Control.ZoomPanel(),
new OpenLayers.Control.ScaleLine(),
new OpenLayers.Control.KeyboardDefaults()
],maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
20037508, 20037508.34)});
osm = new
OpenLayers.Layer.OSM('nic',"http://a.tile.openstreetmap.org/${z}/${x}/${y}.png",
{maxScale: 100000});
map.addLayer(osm);
osmLocal=new OpenLayers.Layer.OSM("neco","tiles/${z}/${x}/${y}.png",
{minScale: 100000})
map.addLayer(osmLocal);
Thanks for help,
Dan
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Displaying-Base-layers-by-Zoom-Scale-tp3929767p4666866.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list