var options =
{
projection: "EPSG:900913",
displayProjection: "EPSG:4326",
units: 'm'
};
map = new OpenLayers.Map('map', options);
ilceSinir = new OpenLayers.Layer.Vector("İlçe Sınırı",
{
minScale: 150000,
strategies: [new OpenLayers.Strategy.Fixed()],
projection: new OpenLayers.Projection("EPSG:4326"),
protocol: new OpenLayers.Protocol.WFS(
{
version: "1.1.0",
url: "http://localhost:8080/geoserver/wfs",
featurePrefix: 'topp',
featureType: "g_ilce_siniri",
featureNS: "http://www.openplans.org/topp",
geometryName: "bounds"
})
});
Scale isn't working, layer is visible at every zoom.
Answer
how about this:
var options =
{
scales: [50000, 100000, 150000],
minScale: 150000,
projection: "EPSG:900913",
displayProjection: "EPSG:4326",
units: 'm'
};
map = new OpenLayers.Map('map', options);
ilceSinir = new OpenLayers.Layer.Vector("İlçe Sınırı",
{
strategies: [new OpenLayers.Strategy.Fixed()],
projection: new OpenLayers.Projection("EPSG:4326"),
protocol: new OpenLayers.Protocol.WFS(
{
version: "1.1.0",
url: "http://localhost:8080/geoserver/wfs",
featurePrefix: 'topp',
featureType: "g_ilce_siniri",
featureNS: "http://www.openplans.org/topp",
geometryName: "bounds"
})
});
source: http://trac.osgeo.org/openlayers/wiki/SettingZoomLevels
No comments:
Post a Comment