- Timestamp:
- 2019-06-20T18:40:03+12:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/default/js/map-scripts-shapes-util.js
r33168 r33169 534 534 } 535 535 536 537 ShapesUtil.numberOfCoordinatesInBounds = function (shape) { 538 if (shape.type === google.maps.drawing.OverlayType.MARKER){ 539 return 1; 540 } else if (shape.type === google.maps.drawing.OverlayType.RECTANGLE) { 541 return 4; 542 } else if (shape.type === google.maps.drawing.OverlayType.CIRCLE) { 543 return 4; // circles have a rectangular/square bounding box, so 4 coordinates to a circle's bounding box 544 } else if (shape.type === google.maps.drawing.OverlayType.POLYLINE || shape.type === google.maps.drawing.OverlayType.POLYGON) { 545 var path = shape.getPath(); 546 return path.length; 547 } 548 549 console.log("Unrecognised shape, can't calculate the number of coordinates in its bounds"); 550 return -1; 551 } 552 536 553 ShapesUtil.overlayBounds = function (overlays) { 537 554
Note:
See TracChangeset
for help on using the changeset viewer.