Skip to content

Commit fa80ccd

Browse files
committed
Document Geographic Details should now uses Leaflet for OSM view, and added configuration options to component
git-svn-id: https://share-extras.googlecode.com/svn/trunk/Document Geographic Details@909 a3f5c567-fd0f-3a89-9b71-a290c5a5f590
1 parent c50ee5d commit fa80ccd

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<osm-map>
2+
<!-- Either leaflet or openlayers -->
3+
<mapType>leaflet</mapType>
4+
<!-- Map zoom 0-18 (larger numbers have greater zoom level) -->
5+
<mapInitialZoom>15</mapInitialZoom>
6+
<!-- Leaflet tile URL template - see http://leaflet.cloudmade.com/reference.html#tilelayer -->
7+
<leafletTileUrl>http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png</leafletTileUrl>
8+
<!-- Whether to display the location retrieved from from reverse geocode service -->
9+
<loadLocation>true</loadLocation>
10+
</osm-map>
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<#include "/org/alfresco/components/component.head.inc">
22
<!-- OpenStreetMap Map -->
33
<@link rel="stylesheet" type="text/css" href="${page.url.context}/res/extras/components/geographic/osm-map.css" />
4+
<@script type="text/javascript" src="${page.url.context}/res/extras/components/geographic/osm-map.js"></@script>
5+
<#--
46
<script type="text/javascript" src="${page.url.context}/res/extras/modules/geographic/openlayers/OpenLayers.js"></script>
5-
<@script type="text/javascript" src="${page.url.context}/res/extras/components/geographic/osm-map.js"></@script>
7+
-->
8+
<!-- Leaflet -->
9+
<link rel="stylesheet" type="text/css" href="${page.url.context}/res/extras/modules/geographic/leaflet/leaflet.css" />
10+
<script type="text/javascript" src="${page.url.context}/res/extras/modules/geographic/leaflet/leaflet.js"></script>

alfresco/site-webscripts/org/sharextras/components/geographic/osm-map.get.html.ftl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
new Extras.component.OSMMap("${id}").setOptions(
1111
{
1212
documentDetails: ${documentDetailsJSON},
13+
mapType: "${config.script["osm-map"].mapType?js_string}",
14+
mapInitialZoom: "${config.script["osm-map"].mapInitialZoom?js_string}",
15+
leafletTileUrl: "${(config.script["osm-map"].leafletTileUrl!'')?js_string}",
16+
loadLocation: ${(config.script["osm-map"].loadLocation!true)?string}
1317
}).setMessages(${messages});
1418
//]]></script>
1519

alfresco/site-webscripts/org/sharextras/components/geographic/osm-map.get.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,6 @@ label.exif_resolutionUnit.title=Resolution Unit
3131
label.exif_resolutionUnit.description=Unit used for horizontal and vertical resolution
3232

3333
# Custom OSM labels
34-
label.locationName=Showing item in {0}
34+
label.locationName=Showing item in {0}
35+
label.copyright.osm=Map data © OpenStreetMap contributors
36+
error.badMapType=Bad map type or map type not available

0 commit comments

Comments
 (0)