From 3390defd3d77ff49fa2d0c234ccf61fdddc9241c Mon Sep 17 00:00:00 2001 From: Silvio Date: Mon, 22 Apr 2013 15:07:18 -0300 Subject: Adding panoramio code --- gmap_arcgis.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) 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); + }); + } + }, } }; -- cgit v1.2.3