0
我正在與osm的pathcreator工作。添加線條工作正常,但是當一條線條很長並放大時,線條會以較高的縮放級別消失。看起來,如果視口遠離行的開始和/或結束點,就會出現這種情況。也許分割線可能會有幫助,但是這是最大尺寸?打開街道地圖長線消失在高縮放級別
這裏是縮小的一個代碼示例,如果放大到7級行消失:
$(document).ready(function() {
var map = new OpenLayers.Map('map');
var mapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik");
map.addLayer(mapnik);
var path = new OpenLayers.Layer.Vector("path");
map.addLayer(path);
var pathStyle = {
strokeColor: "#0033ff",
strokeOpacity: 0.7,
strokeWidth: 5
};
var points = new Array(
new OpenLayers.Geometry.Point(-7856503.5146562, 880554.5664875),
new OpenLayers.Geometry.Point(8502243.5278938, 724011.5325875)
);
var line = new OpenLayers.Geometry.LineString(points);
var lineFeature = new OpenLayers.Feature.Vector(line, null, pathStyle);
path.addFeatures([lineFeature]);
map.zoomToExtent(path.getDataExtent());
});
我是很新的OSM所以也許我只是搞亂了東西..任何想法?在此先感謝