Skip to content

Commit

Permalink
Ability to specify circle options (patch submitted by @bobhutch in #3)
Browse files Browse the repository at this point in the history
  • Loading branch information
heyman committed Apr 29, 2014
1 parent 50a020c commit 74c362f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/leaflet.usermarker.js
Expand Up @@ -44,21 +44,23 @@
weight: 3,
opacity: 0.5,
fillOpacity: 0.15,
fillColor: "#03f",
clickable: false
};

L.UserMarker = L.Marker.extend({
options: {
pulsing: false,
smallIcon: false,
accuracy: 0
accuracy: 0,
circleOpts: circleStyle
},

initialize: function(latlng, options) {
options = L.Util.setOptions(this, options);

this.setPulsing(this.options.pulsing);
this._accMarker = L.circle(latlng, this.options.accuracy, circleStyle);
this._accMarker = L.circle(latlng, this.options.accuracy, this.options.circleOpts);

// call super
L.Marker.prototype.initialize.call(this, latlng, this.options);
Expand All @@ -83,7 +85,7 @@
setAccuracy: function(accuracy) {
this._accuracy = accuracy;
if (!this._accMarker) {
this._accMarker = L.circle(this._latlng, accuracy, circleStyle).addTo(this._map);
this._accMarker = L.circle(this._latlng, accuracy, this.options.circleOpts).addTo(this._map);
} else {
this._accMarker.setRadius(accuracy);
}
Expand Down

0 comments on commit 74c362f

Please sign in to comment.