try to add support for OpenStreetMap's marker and layer

svn: r17953
This commit is contained in:
Jérôme Rapinat 2011-07-24 13:25:47 +00:00
parent 17a863b4cc
commit 569c9f790d

View File

@ -121,36 +121,36 @@ _COPY_OPTIONS = [
# NarrativeWeb javascript code for PlacePage's "Open Street Map"...
openstreet_jsc = """
var marker;
var map;
var marker;
var map;
OpenLayers.Lang.setCode("%s");
OpenLayers.Lang.setCode("%s");
function mapInit(){
map = createMap("map");
function init(){
map = new OpenLayers.Map("map_canvas");
map.dataLayer = new OpenLayers.OSM(document.getElementById("map_canvas"), { "visibility": true });
map.dataLayer.events.register("visibilitychanged", map.dataLayer, toggleData);
map.addLayer(map.dataLayer);
map.addLayer(new OpenLayers.Layer.OSM());
map.dataLayer.events.register("visibilitychanged", map.dataLayer, toggleData);
map.addLayer(map.dataLayer);
var centre = new OpenLayers.LonLat(%s, %s);
var zoom = 11;
var centre = new OpenLayers.LonLat(%s, %s);
var zoom = 11;
setMapCenter(centre, zoom);
map.setCenter(centre, zoom);
updateLocation();
updateLocation();
var markers = new OpenLayers.Layer.Markers("Markers");
map.addLayer(markers);
var markers = new OpenLayers.Layer.Markers("Markers");
map.addLayer(markers);
markers.addMarker(new OpenLayers.Marker(centre));
markers.addMarker(new OpenLayers.Marker(centre));
setMapLayers("M");
setMapLayers("M");
map.events.register("moveend", map, updateLocation);
map.events.register("changelayer", map, updateLocation);
map.events.register("moveend", map, updateLocation);
map.events.register("changelayer", map, updateLocation);
handleResize();
handleResize();
}"""
# NarrativeWeb javascript code for PlacePage's "Google Maps"...