- Timestamp:
- 2019-07-05T19:42:13+12:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/default/js/map-scripts-editor.js
r33150 r33300 313 313 var that = this; 314 314 315 // By default, the map editor will be centred on Waikato Uni at a particular zoom 315 316 this.map = new google.maps.Map(document.getElementById("map-" + this.id), { 316 317 center: { … … 496 497 var nodeID = this.id; // documentID, hopefully contains section ID too 497 498 var metaname = gps_metadata_name; 498 499 499 500 // collection, site, documentID, metadataName, metadataPosition, responseFunction 500 501 gs.functions.getArchivesMetadata(collection, site_name, nodeID, metaname, 0, function(responseText){ … … 507 508 that.LOAD(JSONString, nodeID); 508 509 that.savedOverlays = JSONString; 510 511 // centre on the map's overlays now they're loaded up 512 var map_editor = gsmap_store["map-"+nodeID]; 513 var overlayBounds = ShapesUtil.overlayBounds(map_editor.overlays); 514 if(map_editor.overlays.length === 1 && map_editor.overlays[0].type === google.maps.drawing.OverlayType.MARKER) { 515 that.map.setCenter(overlayBounds.getCenter()); 516 that.map.setZoom(18); 517 } else { 518 that.map.fitBounds(overlayBounds); 519 } 509 520 } 510 521 }
Note:
See TracChangeset
for help on using the changeset viewer.