根據OpenLayers的說法,Openlayers.Layer.GML已經過折舊,並且在Ver。 2.12。我需要移動到矢量圖層,但我無法弄清楚。如何從OpenLayers中的GML矢量圖層升級到VECTOR
在我以前的版本我已經把它定義爲:
//Locations and UnitLocations layer - GeoJSON
var LocationStyle = new OpenLayers.Style({
strokeColor: "#5B5B5B",
strokeWidth: 1,
fillColor: "#F4FBA1",
pointRadius: 10,
strokeOpacity: 0.8,
fillOpacity: 0.8,
label: "${Location}",
labelYOffset: "-20",
labelAlign: "cc",
fontColor: "#000000",
fontOpacity: 1,
fontFamily: "Arial",
fontSize: 12,
fontWeight: "300"
});
var LocationURL = "http://bit.ly/Nfe6IH?q=ICS_Locations&IncidentCode=" + "VAJA%20PSI%2012" + "&key=" + Math.random();
Locations = new OpenLayers.Layer.GML("Locations", LocationURL, {
format: OpenLayers.Format.GeoJSON,
projection: new OpenLayers.Projection("EPSG:4326"), //4326 for WGS84
styleMap: new OpenLayers.StyleMap(LocationStyle)
});
在版本。 Openlayers的2.12版本不再支持。你有什麼樣的例子,我怎麼能做到這一點?
謝謝。
可能是值得一問這對gis.stackexchange.com。在那裏有更多知識淵博的OpenLayers專家! – 2012-08-09 14:35:00