summaryrefslogtreecommitdiff
path: root/map.js
diff options
context:
space:
mode:
authorChristian Pointner <equinox@ffgraz.net>2008-12-07 01:02:36 +0000
committerChristian Pointner <equinox@ffgraz.net>2008-12-07 01:02:36 +0000
commit8b744670bfb9f72c2d52d5373c43dcd5ce5e959a (patch)
treeed2018dfec2fabbfe73455907a31edcbb3a95aa7 /map.js
parent3d4bdf9088184500442c451b237fcc2e954a7b21 (diff)
added add location info text
Diffstat (limited to 'map.js')
-rw-r--r--map.js30
1 files changed, 25 insertions, 5 deletions
diff --git a/map.js b/map.js
index 6a4d1ab..499456a 100644
--- a/map.js
+++ b/map.js
@@ -259,11 +259,6 @@ function makeWeight(value) {
}
}
-function addNewNodeText(point) {
- var html = "adding location at: <br />\n" + point;
- return html;
-}
-
function makeIcon(type) {
var icon = new GIcon();
@@ -308,6 +303,31 @@ function showElements(elements) {
if(elements.select(o)) elements.overlays[o].show();
}
+
+function addNewNodeText(point) {
+ var x_startpoint = 4080;
+ var lng_startpoint = 15.43844103813;
+ var dx_dlng = 50675.5176;
+ var y_startpoint = 4806;
+ var lat_startpoint = 47.07177327969;
+ var dy_dlat = 75505.521;
+
+ var pixel_x = parseInt(Math.floor(x_startpoint + (point.x - lng_startpoint) * dx_dlng));
+ var pixel_y = parseInt(Math.floor(y_startpoint - (point.y - lat_startpoint) * dy_dlat));
+
+ var link = 'https://manman.graz.funkfeuer.at/location/new?';
+ link += 'z_x=' + Math.floor(pixel_x % 100) + '&z_y=' + Math.floor(pixel_y % 100);
+ link += '&c=' + Math.floor(pixel_x / 100) + '&r=' + Math.floor(pixel_y / 100);
+
+ var html = '<b>Neuen Knoten eintragen<br />Nutzen sie den Zoombereich aus!<br /></b>';
+ html += '<table>';
+ html += '<tr><td>Location pinnen:</td><td>&nbsp;</td><td><a href="'+link +'">Link</a></td></tr>';
+ html += '<tr><td>Breitengrad:</td><td>&nbsp;</td><td>' + convertCoords(point.y) + '</td></tr>';
+ html += '<tr><td>Längengrad:</b></td><td>&nbsp;</td><td>' + convertCoords(point.x)+ '</td></tr>'
+ html += '</table>';
+ return html;
+}
+
function setNewMarker(point) {
var marker = new GMarker(point,{icon: makeIcon('newnode'), draggable: true});
GEvent.addListener(marker, "dragstart",