Patrick Brosi 4 years ago
parent
commit
fb3c18d346
2 changed files with 13 additions and 12 deletions
  1. 10 11
      web/index.html
  2. 3 1
      web/script.js

File diff suppressed because it is too large
+ 10 - 11
web/index.html


+ 3 - 1
web/script.js

@@ -376,6 +376,7 @@ map.addControl(L.control.attribution({
376
 map.on('popupopen', function(e) {
376
 map.on('popupopen', function(e) {
377
     var z = Math.max(map.getZoom(), 16);
377
     var z = Math.max(map.getZoom(), 16);
378
     var px = map.project(e.target._popup._latlng, z);
378
     var px = map.project(e.target._popup._latlng, z);
379
+    px.x += e.target._popup._container.clientWidth/2 - 20;
379
     px.y -= e.target._popup._container.clientHeight/2;
380
     px.y -= e.target._popup._container.clientHeight/2;
380
 
381
 
381
     map.setView(map.unproject(px, z), z, {animate: true});
382
     map.setView(map.unproject(px, z), z, {animate: true});
@@ -520,7 +521,7 @@ function s(q) {
520
     if (q == prevSearch) return;
521
     if (q == prevSearch) return;
521
     clearTimeout(delayTimer);
522
     clearTimeout(delayTimer);
522
     prevSearch = q;
523
     prevSearch = q;
523
-    unselect(selectedRes);
524
+    //unselect(selectedRes);
524
     if (!q) {
525
     if (!q) {
525
         $('#si').value = "";
526
         $('#si').value = "";
526
         $("#sres").className = "";
527
         $("#sres").className = "";
@@ -567,6 +568,7 @@ function s(q) {
567
                     }
568
                     }
568
                     res.appendChild(row);
569
                     res.appendChild(row);
569
                 }
570
                 }
571
+                if ($('.sres').length > 0) select($('.sres')[0]);
570
             }
572
             }
571
         )}, delay);
573
         )}, delay);
572
 }
574
 }