aboutsummaryrefslogtreecommitdiff
path: root/gmap_arcgis.js
diff options
context:
space:
mode:
Diffstat (limited to 'gmap_arcgis.js')
-rw-r--r--gmap_arcgis.js35
1 files changed, 20 insertions, 15 deletions
diff --git a/gmap_arcgis.js b/gmap_arcgis.js
index 190f9b3..c1023c9 100644
--- a/gmap_arcgis.js
+++ b/gmap_arcgis.js
@@ -46,6 +46,25 @@ function gmapArcgis(config) {
params.overlay.setMap(this.map);
params.overlay.setOpacity(params.opacity);
+ this.identifyPolygon(params);
+
+ if (params.callback == undefined) {
+ // Default callback: remove the blockUI once the layer is shown
+ google.maps.event.addListener(params.overlay.getMapService(), 'update', function() {
+ this.unblockUI();
+ });
+ }
+ else {
+ google.maps.event.addListener(params.overlay.getMapService(), 'update', function() {
+ params.callback(this.map, params) ; this.unblockUI();
+ });
+ }
+
+ return params.overlay;
+ },
+
+ // Add an identify callback to a layer
+ identifyPolygon: function(params) {
// See https://google-maps-utility-library-v3.googlecode.com/svn/trunk/arcgislink/examples/identify.js
if (typeof params.identify != 'undefined') {
var self = this;
@@ -62,20 +81,6 @@ function gmapArcgis(config) {
});
});
}
-
- if (params.callback == undefined) {
- // Default callback: remove the blockUI once the layer is shown
- google.maps.event.addListener(params.overlay.getMapService(), 'update', function() {
- this.unblockUI();
- });
- }
- else {
- google.maps.event.addListener(params.overlay.getMapService(), 'update', function() {
- params.callback(this.map, params) ; this.unblockUI();
- });
- }
-
- return params.overlay;
},
// Add a KML to the map
@@ -107,9 +112,9 @@ function gmapArcgis(config) {
addLayers: function(element) {
this.config['layers'][element].opacity = this.defaultOpacity(element);
- // TODO: add identify listener
if (typeof this.config['layers'][element].overlay != 'undefined') {
this.config['layers'][element].overlay.setOpacity(this.config['layers'][element].opacity);
+ this.identifyPolygon(this.config['layers'][element]);
this.unblockUI();
return;
}