Index: trunk/extensions/SemanticMaps/OpenLayers/SM_OpenLayersFunctions.js |
— | — | @@ -9,16 +9,15 @@ |
10 | 10 | |
11 | 11 | /** |
12 | 12 | * This function holds spesific functionallity for the Open Layers form input of Semantic Maps |
13 | | - * TODO: Refactor as much code as possible to non specific functions |
14 | 13 | */ |
15 | 14 | function makeFormInputOpenLayer(mapName, locationFieldName, lat, lon, zoom, marker_lat, marker_lon, layers, controls, height) { |
16 | 15 | var markers = Array(); |
17 | 16 | |
18 | 17 | // Show a starting marker only if marker coordinates are provided |
19 | 18 | if (marker_lat != null && marker_lon != null) { |
20 | | - markers.push(getOLMarkerData(marker_lon, marker_lat, '', '')); |
21 | | - } |
22 | | - |
| 19 | + markers.push(getOLMarkerData(marker_lon, marker_lat, '', '', '')); |
| 20 | + } |
| 21 | + |
23 | 22 | // Click event handler for updating the location of the marker |
24 | 23 | // TODO / FIXME: This will probably cause problems when used for multiple maps on one page. |
25 | 24 | OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { |
— | — | @@ -45,8 +44,14 @@ |
46 | 45 | }, |
47 | 46 | |
48 | 47 | trigger: function(e) { |
49 | | - replaceMarker(mapName, map.getLonLatFromViewPortPx(e.xy)); |
50 | | - document.getElementById(locationFieldName).value = convertLatToDMS(map.getLonLatFromViewPortPx(e.xy).lat)+', '+convertLngToDMS(map.getLonLatFromViewPortPx(e.xy).lon); |
| 48 | + var lonlat = map.getLonLatFromViewPortPx(e.xy); |
| 49 | + |
| 50 | + replaceMarker(mapName, lonlat); |
| 51 | + |
| 52 | + var proj = new OpenLayers.Projection("EPSG:4326"); |
| 53 | + lonlat.transform(map.getProjectionObject(), proj); |
| 54 | + |
| 55 | + document.getElementById(locationFieldName).value = convertLatToDMS(lonlat.lat)+', '+convertLngToDMS(lonlat.lon); |
51 | 56 | } |
52 | 57 | |
53 | 58 | }); |
— | — | @@ -73,7 +78,7 @@ |
74 | 79 | var markerLayer = map.getLayer('markerLayer'); |
75 | 80 | |
76 | 81 | removeMarkers(markerLayer); |
77 | | - markerLayer.addMarker(getOLMarker(markerLayer, getOLMarkerData(newLocation.lon, newLocation.lat, '', ''), map.getProjectionObject())); |
| 82 | + markerLayer.addMarker(getOLMarker(markerLayer, getOLMarkerData(newLocation.lon, newLocation.lat, '', '', ''), map.getProjectionObject())); |
78 | 83 | |
79 | 84 | map.panTo(newLocation); |
80 | 85 | } |
Index: trunk/extensions/SemanticMaps/SemanticMaps.php |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | |
37 | 37 | // Only initialize the extension when all dependencies are present. |
38 | 38 | if (defined( 'Maps_VERSION' ) && defined( 'SMW_VERSION' )) { |
39 | | - define('SM_VERSION', '0.5.3 a3'); |
| 39 | + define('SM_VERSION', '0.5.3 a5'); |
40 | 40 | |
41 | 41 | $smgScriptPath = $wgScriptPath . '/extensions/SemanticMaps'; |
42 | 42 | $smgIP = $IP . '/extensions/SemanticMaps'; |