Changeset 33172
- Timestamp:
- 2019-06-20T22:47:33+12:00 (5 years ago)
- Location:
- main/trunk/greenstone3/web/interfaces/default
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/default/js/map-scripts.js
r33169 r33172 367 367 } 368 368 369 if(doc.coords) {369 /*if(doc.coords) { 370 370 //console.log("@@@@ HERE IN doc.coords"); 371 371 for(var x = 0; x < doc.coords.length; x++) { … … 374 374 bounds.extend(new google.maps.LatLng(coordInfo.lat, coordInfo.lng)); 375 375 } 376 } 376 }*/ 377 377 378 378 if(doc.mapoverlay) { … … 495 495 496 496 function focusDocument(id) 497 { 497 { 498 498 var doc = _docList[id]; 499 499 if(doc) … … 501 501 clearInterval(_intervalHandle); 502 502 _intervalHandle = null; 503 if(doc.coords) {503 /*if(doc.coords) { 504 504 for(var x = 0; x < doc.coords.length; x++) { 505 505 var coord = doc.coords[x]; … … 507 507 _map.panTo(new google.maps.LatLng(coordInfo.lat, coordInfo.lng)); 508 508 } 509 }*/ 510 if(doc.shapes) { 511 var docShapesBounds = ShapesUtil.overlayBounds(doc.shapes); 512 _map.panToBounds(docShapesBounds); // https://developers.google.com/maps/documentation/javascript/reference/map#Map.panToBounds 509 513 } else { 510 514 _map.panTo(new google.maps.LatLng(doc.lat, doc.lng)); 511 515 } 516 512 517 clearAllInfoBoxes(); 513 doc.marker.markerInfo.open(_map, doc.marker); 518 if(doc.shapes) { // TODO 519 //console.log("Opening infowindow for doc " + doc.nodeID); 520 for(var x = 0; x < doc.shapes.length; x++) { 521 if(doc.shapes[x].markerInfo) { 522 doc.shapes[x].markerInfo.open(_map); // label 523 } 524 else { 525 console.log("No infowindow for doc " + doc.nodeID + "'s shape " + doc.shapes[x].type); 526 } 527 } 528 //openInfoBoxes(doc); 529 } else { // only Lat and Lng meta, so we have just one marker per doc, which will have the doc title not label 530 doc.marker.markerInfo.open(_map, doc.marker); // doc title 531 } 514 532 var scrollCheckbox = $("#scrollCheckbox"); 515 533 if(scrollCheckbox.checked) … … 525 543 { 526 544 var doc = _docList.getDocByIndex(i); 527 doc.marker.markerInfo.close(); 545 546 if(doc.shapes) { 547 for(var x = 0; x < doc.shapes.length; x++) { 548 if(doc.shapes[x].markerInfo) { 549 //console.log("Closing infowindow for doc " + _docList.ids[i]); 550 doc.shapes[x].markerInfo.close(); 551 } 552 } 553 } 554 else { // only Lat and Lng meta, so we have just one marker per doc 555 doc.marker.markerInfo.close(); 556 } 528 557 } 529 558 } … … 556 585 557 586 if(shape.type === google.maps.drawing.OverlayType.MARKER) { 558 var marker = shape; 587 var marker = shape; 588 console.log("Coord for marker is " + coord.toString()); 589 559 590 marker.addListener('mouseover', function() { 560 591 infoWindow.open(_map, marker); … … 578 609 } 579 610 shape.markerInfo = infoWindow; 611 console.log("######## Added markerInfo object to shape"); 580 612 } 581 613 … … 623 655 shape.draggable = false; 624 656 625 657 console.log("#### calling addInfoMarker"); 626 658 // doc[i]'s label = doc.shapes[i].description 627 659 addInfoMarker(doc, shape); 628 } 660 } 629 661 630 662 var docElement = gs.jqGet("div" + doc.nodeID); -
main/trunk/greenstone3/web/interfaces/default/transform/map-tools.xsl
r33140 r33172 18 18 19 19 <xsl:template name="mapFeaturesJSONNodes"> 20 <div id="jsonNodes" style="display:none;" >20 <div id="jsonNodes" style="display:none;" debug="true"> 21 21 <xsl:text>[</xsl:text> 22 22 <xsl:for-each select="//documentNode"> … … 37 37 <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Longitude']"/> 38 38 </xsl:if> 39 <!-- 39 40 <xsl:if test="metadataList/metadata[@name = 'Coordinate']"> 40 41 <xsl:text disable-output-escaping="yes">,</xsl:text> … … 49 50 <xsl:text>]</xsl:text> 50 51 </xsl:if> 51 52 --> 52 53 <xsl:if test="metadataList/metadata[@name = 'GPS.mapOverlay']"> 53 54 <xsl:text disable-output-escaping="yes">,</xsl:text> -
main/trunk/greenstone3/web/interfaces/default/transform/pages/document.xsl
r33140 r33172 854 854 <xsl:text disable-output-escaping="yes">"lng":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Longitude']"/> 855 855 </xsl:if> 856 <!-- 856 857 <xsl:if test="metadataList/metadata[@name = 'Coordinate']"> 857 858 <xsl:text disable-output-escaping="yes">,</xsl:text> … … 861 862 <xsl:text disable-output-escaping="yes">"</xsl:text> 862 863 <xsl:value-of disable-output-escaping="yes" select="current()"/> 863 <xsl:text disable-output-escaping="yes">"</xsl:text> 864 <!--<xsl:if test="not(position() = count(metadataList/metadata[@name = 'Coordinate'])"> 865 <xsl:text>,</xsl:text> 866 </xsl:if> 867 --> 864 <xsl:text disable-output-escaping="yes">"</xsl:text> 868 865 <xsl:text disable-output-escaping="yes">,</xsl:text> 869 866 </xsl:for-each> 870 867 <xsl:text>]</xsl:text> 871 868 </xsl:if> 872 869 --> 873 870 <xsl:if test="metadataList/metadata[@name = 'GPS.mapOverlay']"> 874 871 <xsl:text disable-output-escaping="yes">,</xsl:text> … … 899 896 <xsl:text disable-output-escaping="yes">"lng":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Longitude']"/> 900 897 </xsl:if> 898 <!-- 901 899 <xsl:if test="metadataList/metadata[@name = 'Coordinate']"> 902 900 <xsl:text disable-output-escaping="yes">,</xsl:text> … … 911 909 <xsl:text>]</xsl:text> 912 910 </xsl:if> 913 911 --> 914 912 <xsl:if test="metadataList/metadata[@name = 'GPS.mapOverlay']"> 915 913 <xsl:text disable-output-escaping="yes">,</xsl:text>
Note:
See TracChangeset
for help on using the changeset viewer.