0
我有一個GPX軌道(Startpoint == Endpoint)轉換爲GeoJSON。
我現在想要在只顯示trac封閉地圖的地圖上顯示此曲目。其餘的應該是白色的。OpenLayers:兩個GeoJSON層,一個透明
到目前爲止,我有以下幾點:
<script type="text/javascript">
function init() {
map = new OpenLayers.Map("basicMap");
var mapnik = new OpenLayers.Layer.OSM();
var fromProjection = new OpenLayers.Projection("EPSG:4326");
var toProjection = new OpenLayers.Projection("EPSG:900913");
var position = new OpenLayers.LonLat(13.41,52.52).transform(fromProjection, toProjection);
var zoom = 7;
map.addLayer(mapnik);
map.setCenter(position, zoom);
geojson_layer = new OpenLayers.Layer.Vector("GeoJSON", {
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.HTTP({
url: "tracks.json",
format: new OpenLayers.Format.GeoJSON()
})
});
map.addLayer(geojson_layer);
}
</script>
tracks.json與TRAC的GeoJSON的文件。
基本上現在我想要一個矩形周圍的trac。 trac和矩形之間的空白應填充白色。
謝謝你的幫助!
顯示。 – winsent