aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <silvio@socioambiental.org>2013-04-22 15:07:18 -0300
committerSilvio <silvio@socioambiental.org>2013-04-22 15:07:18 -0300
commit3390defd3d77ff49fa2d0c234ccf61fdddc9241c (patch)
tree87d3fbefcb1bd18ca7ca0c1e0451019687ae44ec
parented410cb60ab850e641ca0672243d43154dbb8337 (diff)
downloadgmap_arcgis_js-3390defd3d77ff49fa2d0c234ccf61fdddc9241c.tar.gz
gmap_arcgis_js-3390defd3d77ff49fa2d0c234ccf61fdddc9241c.tar.bz2
Adding panoramio code
-rw-r--r--gmap_arcgis.js32
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);
+ });
+ }
+ },
}
};