changeset 137:c7a141d5ce39 gmap2

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 09 Mar 2014 14:58:19 +0200
parents 8cb2e471c894
children fdcfafb77fea
files map.js markers.js overlay.php
diffstat 3 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/map.js	Sun Mar 09 14:00:26 2014 +0200
+++ b/map.js	Sun Mar 09 14:58:19 2014 +0200
@@ -28,7 +28,7 @@
 map.setCenter(proj.fromPixelToLatLng(new GPoint(8556,8664), 6), 3, custommap);
 
 
-function checkCoords(cx, cy, cxmin, cymin, cxmax, cymax, cname)
+function pmapCheckCoords(cx, cy, cxmin, cymin, cxmax, cymax, cname)
 {
   if (cx > cxmin && cx < cxmax && cy > cymin && cy < cymax)
     return { x: cx + cxmin, y: cy + cymin, name: cname };
--- a/markers.js	Sun Mar 09 14:00:26 2014 +0200
+++ b/markers.js	Sun Mar 09 14:58:19 2014 +0200
@@ -23,7 +23,14 @@
 
 function pmapMyClick(i)
 {
-  map.panTo(pmap_markers[i]);
+  map.panTo(pmap_markers[i].getLatLng());
+  setTimeout("pmapShowInfo("+ i +")", 1000);
+}
+
+
+function pmapShowInfo(i)
+{
+  GEvent.trigger(pmap_markers[i], "click");
 }
 
 
@@ -35,7 +42,7 @@
     marker.openInfoWindowHtml("<div style=\"color:#000;\">"+html+"</div>");
   });
 
-  pmap_markers[pmap_mindex] = point;
+  pmap_markers[pmap_mindex] = marker;
 
   if (sidebar == "builtin")
   {
@@ -76,7 +83,7 @@
     var p = proj.fromPixelToLatLng(new GPoint(x*2+1,y*2+1),7);
     var marker = pmapCreateMarker(p, name, html, icons[type], type, continent, "builtin");
     if (pmap_areas[type] == undefined) pmap_areas[type] = [];
-    pmap_areas[type].push(marker);    
+    pmap_areas[type].push(marker);
   }
 
   mgr.addMarkers(pmap_areas["default"], 7, 11);
--- a/overlay.php	Sun Mar 09 14:00:26 2014 +0200
+++ b/overlay.php	Sun Mar 09 14:58:19 2014 +0200
@@ -69,7 +69,7 @@
     {
       imagefilledrectangle($im,$xoffs-$xorig,$yoffs-$yorig,$xoffs-$xorig+$zoom-1,$yoffs-$yorig+$zoom-1,$c_black);
       imagettftext($im,$fontsize[$zoom],0,$xoffs-$xorig+$fontsize[$zoom]/4,$yoffs-$yorig+$fontsize[$zoom], $c_white, $fontfile, $char);
-      imagechar($im,$fontsize[$zoom],$xoffs-$xorig,$yoffs-$yorig,$char,$c_white);
+      //imagechar($im,$fontsize[$zoom],$xoffs-$xorig,$yoffs-$yorig,$char,$c_white);
       $flag = TRUE;
     }
   }