Sha256: d571d3f2f194d25e6614196f83618cdfd265cf8f075bf7cbd78b8685e961b726

Contents?: true

Size: 1012 Bytes

Versions: 3

Compression:

Stored size: 1012 Bytes

Contents

/*
 * L.CircleMarker is a circle overlay with a permanent pixel radius.
 */

L.CircleMarker = L.Circle.extend({
	options: {
		radius: 10,
		weight: 2
	},

	initialize: function (latlng, options) {
		L.Circle.prototype.initialize.call(this, latlng, null, options);
		this._radius = this.options.radius;
	},

	projectLatlngs: function () {
		this._point = this._map.latLngToLayerPoint(this._latlng);
	},

	_updateStyle : function () {
		L.Circle.prototype._updateStyle.call(this);
		this.setRadius(this.options.radius);
	},

	setLatLng: function (latlng) {
		L.Circle.prototype.setLatLng.call(this, latlng);
		if (this._popup && this._popup._isOpen) {
			this._popup.setLatLng(latlng);
		}
		return this;
	},

	setRadius: function (radius) {
		this.options.radius = this._radius = radius;
		return this.redraw();
	},

	getRadius: function () {
		return this._radius;
	}
});

L.circleMarker = function (latlng, options) {
	return new L.CircleMarker(latlng, options);
};

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
leaflet-js-0.7.9 vendor/assets/Leaflet/src/layer/vector/CircleMarker.js
leaflet-js-0.7.8 vendor/assets/Leaflet/src/layer/vector/CircleMarker.js
leaflet-js-0.7.7 vendor/assets/Leaflet/src/layer/vector/CircleMarker.js