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
This commit is contained in:
@@ -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}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user