Ignore:
Timestamp:
2019-05-31T21:35:03+12:00 (5 years ago)
Author:
wy59
Message:

Incremental changes following previous commit. This time the code is more backwards compatible with older collections that contain only Latitude and Longitude meta. In such cases, we now ADDITIONALLY add Coordinate (and Coordshort) meta, while still also outputting Lat and Lng meta. The JS and XSL code however now prefers to work with Coordinate meta where present.

File:
1 edited

Legend:

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

    r33125 r33126  
    2525    {
    2626        console.log("@@@ JSON node div html: " + jsonNodeDiv.html());
    27        
    2827        var jsonNodes = eval(jsonNodeDiv.html());
     28       
    2929        if(jsonNodes && jsonNodes.length > 0)
    3030        {
     
    337337        }
    338338
    339         if(!doc.lat) {
     339        if(doc.coord) {
    340340            var coordInfo = getLatLngForCoord(doc.coord);
    341341            bounds.extend(new google.maps.LatLng(coordInfo.lat, coordInfo.lng));
     
    463463        clearInterval(_intervalHandle);
    464464        _intervalHandle = null;
    465         if(!doc.lat) {
     465        if(doc.coord) {
    466466            var coordInfo = getLatLngForCoord(doc.coord);
    467467            _map.panTo(new google.maps.LatLng(coordInfo.lat, coordInfo.lng));
     
    491491{
    492492    var pos;
    493     if(doc.lat) {
     493    if(doc.coord) {
     494        var coordInfo = getLatLngForCoord(doc.coord);           
     495        pos = new google.maps.LatLng(coordInfo.lat,coordInfo.lng);     
     496    } else {
    494497        pos = new google.maps.LatLng(doc.lat,doc.lng);
    495     } else {
    496         var coordInfo = getLatLngForCoord(doc.coord);           
    497         pos = new google.maps.LatLng(coordInfo.lat,coordInfo.lng);
    498498    }
    499499   
Note: See TracChangeset for help on using the changeset viewer.