Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/android/plugin/google/maps/PluginMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -3179,5 +3179,20 @@ public void onRequestPermissionResult(int requestCode, String[] permissions,
}
}

public void setClickablePOI(JSONArray args, final CallbackContext callbackContext) throws JSONException {
final boolean clickable = args.getBoolean(0);
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
if (clickable) {
map.setOnPoiClickListener(PluginMap.this);
} else {
map.setOnPoiClickListener(null);
}

callbackContext.success();
}
});
}

}
13 changes: 13 additions & 0 deletions www/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ Map.prototype.getMap = function(meta, div, options) {
args = [meta];
options = options || {};

self.set('clickablePOI', true) // Current POI are clickable by default

self.set('clickable', options.clickable === false ? false : true);
self.set('visible', options.visible === false ? false : true);

Expand Down Expand Up @@ -1586,4 +1588,15 @@ Map.prototype._onCameraEvent = function(eventName, cameraPosition) {
}
};

Map.prototype.setClickablePOI = function(isClickable) {
var self = this;
isClickable = common.parseBoolean(isClickable);
self.set('clickablePOI', isClickable);
self.exec.call(self, null, self.errorHandler, this.__pgmId, 'setClickablePOI', [isClickable]);
return this;
};
Map.prototype.getClickablePOI = function() {
return this.get('clickablePOI');
};

module.exports = Map;