I have a GPX Track (Startpoint == Endpoint) converted to GeoJSON.
I now want to display this track on a map where only by the trac enclosed map shown. The rest should be white.
So far I have the following:
<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 is the GeoJSON file with the trac.
Basicly now I want a rectangle around the trac. The space between trac and rectangle should be filled white.
Thank you for your help!