aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gmap_arcgis.js19
1 files changed, 18 insertions, 1 deletions
diff --git a/gmap_arcgis.js b/gmap_arcgis.js
index 89193f7..e58bae4 100644
--- a/gmap_arcgis.js
+++ b/gmap_arcgis.js
@@ -68,12 +68,28 @@ function gmapArcgis(config) {
// See https://google-maps-utility-library-v3.googlecode.com/svn/trunk/arcgislink/examples/identify.js
if (typeof params.identify != 'undefined') {
var self = this;
+
+ // Configure event listener
params.identifyListener = google.maps.event.addListener(this.map, 'click', function(point) {
params.identify.geometry = point.latLng;
params.identify.bounds = self.map.getBounds();
params.identify.width = self.map.getDiv().offsetWidth;
params.identify.height = self.map.getDiv().offsetHeight;
+ // Configure infoWindow
+ if (params.infowindow != undefined) {
+ params.infowindow.close();
+ params.infowindow.setContent('');
+ params.infowindow.setPosition(point.latLng);
+ }
+ else {
+ params.infowindow = new google.maps.InfoWindow({
+ content: '',
+ position: point.latLng,
+ });
+ }
+
+ // Identify layers
params.service.identify(params.identify, function(identify, err) {
if (!err) {
var layers = { };
@@ -93,7 +109,8 @@ function gmapArcgis(config) {
}
}
- params.identify.callback(layers, err);
+ // Callback
+ params.identify.callback(layers, params.infowindow, err);
}
});
});