summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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",