Sha256: f512def21ce570075d175d6b4c730e4135b88817638864d77209761863a24de1

Contents?: true

Size: 996 Bytes

Versions: 5

Compression:

Stored size: 996 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);
		}
	},

	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

5 entries across 5 versions & 1 rubygems

Version Path
leaflet-js-0.7.0.4 lib/leaflet/src/layer/vector/CircleMarker.js
leaflet-js-0.7.0.3 lib/leaflet/src/layer/vector/CircleMarker.js
leaflet-js-0.7.0.2 lib/leaflet/src/layer/vector/CircleMarker.js
leaflet-js-0.7.0.1 lib/leaflet/src/layer/vector/CircleMarker.js
leaflet-js-0.7.0 lib/leaflet/src/layer/vector/CircleMarker.js