diff options
-rw-r--r-- | gmap_arcgis.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gmap_arcgis.js b/gmap_arcgis.js index 35fb4e8..34959a1 100644 --- a/gmap_arcgis.js +++ b/gmap_arcgis.js @@ -507,5 +507,37 @@ function gmapArcgis(config) { } } }, + + // Add panoramio layer + addPanoramio: function() { + if (this.config.panoramio.panoramioLayer == undefined) { + var self = this; + this.showOverlay(1000); + + var photoDiv = document.createElement('div'); + var photoWidgetOptions = this.config.panoramio.photoWidgetOptions; + this.config.panoramio = { }; + this.config.panoramio.photoWidget = new panoramio.PhotoWidget(photoDiv, null, photoWidgetOptions); + this.config.panoramio.infoWindow = new google.maps.InfoWindow(); + this.config.panoramio.panoramioLayer = new google.maps.panoramio.PanoramioLayer({ + suppressInfoWindows: true + }); + + google.maps.event.addListener(this.config.panoramio.panoramioLayer, 'click', function(e) { + var photoRequestOptions = { + ids: [{ + 'photoId': e.featureDetails.photoId, + 'userId': e.featureDetails.userId, + }] + }; + + self.config.panoramio.photoWidget.setRequest(photoRequestOptions); + self.config.panoramio.photoWidget.setPosition(0); + self.config.panoramio.infoWindow.setPosition(e.latLng); + self.config.panoramio.infoWindow.open(self.map); + self.config.panoramio.infoWindow.setContent(photoDiv); + }); + } + }, } }; |