]> git.openstreetmap.org Git - rails.git/commitdiff
The default OpenLayers.Layer.GML style can be nearly invisible when
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 29 Jun 2009 02:11:34 +0000 (02:11 +0000)
committerÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 29 Jun 2009 02:11:34 +0000 (02:11 +0000)
viewed on the main map.

Set a style that's blue (since not a lot of things on the map are
blue), with strokeWidth 3 and opacity 50%. It makes things visible
enough without being too intrusive.

public/javascripts/map.js

index c63461fe203be6c6559464f2c06f649e935ada0d..7c979822711c0c2388386212ffbb4c8d2aa34978 100644 (file)
@@ -111,6 +111,11 @@ function addMarkerToMap(position, icon, description) {
 function addObjectToMap(url, zoom, callback) {
    var layer = new OpenLayers.Layer.GML("Objects", url, {
       format: OpenLayers.Format.OSM,
+      style: {
+          strokeColor: "blue",
+          strokeWidth: 3,
+          strokeOpacity: 0.5
+      },
       projection: new OpenLayers.Projection("EPSG:4326"),
       displayInLayerSwitcher: false
    });