Changeset 33143


Ignore:
Timestamp:
2019-06-10T19:31:26+12:00 (5 years ago)
Author:
wy59
Message:

Bounds extends now works correctly for shapes so that all markers are displayed on the map. We have no way of calculating the correct zoom, though, and the zoom was never calculated before for a single marker (comments said it was randomly set to 18 back then as it looked good).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/js/map-scripts.js

    r33140 r33143  
    330330                    doc.shapes[x].setVisible(false);
    331331                }
     332                markersOnMap = doc.shapes.length;
    332333            } else {
    333334                doc.marker.setVisible(false);
     
    341342                    doc.shapes[x].setVisible(true);
    342343                }
     344                markersOnMap = doc.shapes.length;
    343345            } else {
    344346                doc.marker.setVisible(true);
     
    362364    if(markersOnMap > 1)
    363365    {
     366        //alert("@@@@ fitting bounds, current zoom is: " + _map.getZoom());         
    364367    _map.fitBounds(bounds);
    365368    } else if (markersOnMap == 1) {
     
    535538    if(shape.type === google.maps.drawing.OverlayType.MARKER) {
    536539        var marker = shape;
    537         //marker.addListener('mouseover', function() {
     540        marker.addListener('mouseover', function() {
    538541          infoWindow.open(_map, marker);
    539         //});
     542        });
     543        marker.addListener('mouseout', function() {
     544            infoWindow.close();
     545        });
    540546        attachClickHandler(marker, doc.nodeID); // do what the original code used to do here
    541547    }
Note: See TracChangeset for help on using the changeset viewer.