From cbd921f643fda85fe6f896341df50627aa9b3809 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Tue, 15 Aug 2006 17:48:07 +0000 Subject: [PATCH] Add the ability to add a 'marker=true' option to URL queries, so that you can have a marker at your center point, a la gmaps. git-svn-id: http://svn.openlayers.org/trunk/openlayers@1220 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/mvs.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/mvs.html b/examples/mvs.html index ed467cd295..2f7640a683 100644 --- a/examples/mvs.html +++ b/examples/mvs.html @@ -57,6 +57,7 @@ function runMVS() { theArgs.layers.split(",") : DEFAULT_LAYERS; safeArgs.data = theArgs.data; // TODO: Make this "safe". + safeArgs.marker = theArgs.marker; // TODO: Make this "safe". // ----- var theMVS = new OpenLayers.Map($('map'), {controls: [], maxResolution: 'auto'}); @@ -98,6 +99,11 @@ function runMVS() { } theMVS.setCenter(new OpenLayers.LonLat(safeArgs.centerLon, safeArgs.centerLat), safeArgs.zoom); + if (safeArgs.marker) { + var m = new OpenLayers.Layer.Markers("Marker"); + m.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(safeArgs.centerLon, safeArgs.centerLat))); + theMVS.addLayer(m); + } if (safeArgs.data) { theMVS.addLayer(new OpenLayers.Layer.Text("Data", {location: safeArgs.data})); }