From 490492bd55d6e8f1e8a55c213063cb16ca9219f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Rapinat?= Date: Sun, 24 Jul 2011 12:31:55 +0000 Subject: [PATCH] try to add OpenLayers.js support for OpenStreetMap svn: r17950 --- src/plugins/webreport/NarrativeWeb.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index 281de63ff..fdee48a74 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -2597,6 +2597,11 @@ class PlacePage(BasePage): head += Html("script", type ="text/javascript", src ="http://maps.googleapis.com/maps/api/js?sensor=false", inline =True) + # try to add OpenLayers specific javascript code ... + if self.mapservice == "OpenStreetMap": + head += Html("script", type ="text/javascript", + src ="http://www.openstreetmap.org/openlayers/OpenLayers.js", inline =True) + # section title placedetail += Html("h4", _("Place Map"), inline =True) @@ -2607,7 +2612,7 @@ class PlacePage(BasePage): if self.mapservice == "OpenStreetMap": url = 'http://www.openstreetmap.com/?lat=%s&lon=%s&zoom=11&layers=M' % ( latitude, longitude) - canvas += Html("object", type ="'text/html'", width ="98%", height ="98%", + canvas += Html("object", type ="text/html", width ="98%", height ="98%", data =url) # begin inline javascript code