Skip to content

Commit

Permalink
Pass custom variables to a marker #54
Browse files Browse the repository at this point in the history
#54
Add a params object to marker to add specific parameters (like Id, url, etc.) that can be use in infoClick or other events from marker.getParams()
  • Loading branch information
Jerome2606 committed Jul 30, 2015
1 parent bbe9a96 commit 7faf764
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions www/googlemaps-cdv-plugin.js
Expand Up @@ -886,6 +886,7 @@ App.prototype.addMarker = function(markerOptions, callback) {
markerOptions.rotation = markerOptions.rotation || 0;
markerOptions.opacity = parseFloat("" + markerOptions.opacity, 10) || 1;
markerOptions.disableAutoPan = markerOptions.disableAutoPan === undefined ? false: markerOptions.disableAutoPan;
markerOptions.params = markerOptions.params || {};
if ("styles" in markerOptions) {
markerOptions.styles = typeof markerOptions.styles === "object" ? markerOptions.styles : {};

Expand Down Expand Up @@ -1244,6 +1245,9 @@ Marker.prototype.setDisableAutoPan = function(disableAutoPan) {
this.set('disableAutoPan', disableAutoPan);
cordova.exec(null, this.errorHandler, PLUGIN_NAME, 'exec', ['Marker.setDisableAutoPan', this.getId(), disableAutoPan]);
};
Marker.prototype.getParams = function () {
return this.get('params');
};
Marker.prototype.setOpacity = function(opacity) {
this.set('opacity', opacity);
cordova.exec(null, this.errorHandler, PLUGIN_NAME, 'exec', ['Marker.setOpacity', this.getId(), opacity]);
Expand Down

0 comments on commit 7faf764

Please sign in to comment.