vendor: 1,832 bytes, lines 1-69
1L.Edit = L.Edit || {}; 2/** 3 * @class L.Edit.Circle 4 * @aka Edit.Circle 5 * @inherits L.Edit.CircleMarker 6 */ 7L.Edit.Circle = L.Edit.CircleMarker.extend({ 8 9 _createResizeMarker: function () { 10 var center = this._shape.getLatLng(), 11 resizemarkerPoint = this._getResizeMarkerPoint(center); 12 13 this._resizeMarkers = []; 14 this._resizeMarkers.push(this._createMarker(resizemarkerPoint, this.options.resizeIcon)); 15 }, 16 17 _getResizeMarkerPoint: function (latlng) { 18 // From L.shape.getBounds() 19 var delta = this._shape._radius * Math.cos(Math.PI / 4), 20 point = this._map.project(latlng); 21 return this._map.unproject([point.x + delta, point.y - delta]); 22 }, 23 24 _resize: function (latlng) { 25 var moveLatLng = this._moveMarker.getLatLng(); 26 27 // Calculate the radius based on the version 28 if (L.GeometryUtil.isVersion07x()) { 29 radius = moveLatLng.distanceTo(latlng); 30 } else { 31 radius = this._map.distance(moveLatLng, latlng); 32 } 33 this._shape.setRadius(radius); 34 35 if (this._map.editTooltip) { 36 this._map._editTooltip.updateContent({ 37 text: L.drawLocal.edit.handlers.edit.tooltip.subtext + '<br />' + L.drawLocal.edit.handlers.edit.tooltip.text, 38 subtext: L.drawLocal.draw.handlers.circle.radius + ': ' + 39 L.GeometryUtil.readableDistance(radius, true, this.options.feet, this.options.nautic) 40 }); 41 } 42 43 this._shape.setRadius(radius); 44 45 this._map.fire(L.Draw.Event.EDITRESIZE, {layer: this._shape}); 46 } 47}); 48 49L.Circle.addInitHook(function () { 50 if (L.Edit.Circle) { 51 this.editing = new L.Edit.Circle(this); 52 53 if (this.options.editable) { 54 this.editing.enable(); 55 } 56 } 57 58 this.on('add', function () { 59 if (this.editing && this.editing.enabled()) { 60 this.editing.addHooks(); 61 } 62 }); 63 64 this.on('remove', function () { 65 if (this.editing && this.editing.enabled()) { 66 this.editing.removeHooks(); 67 } 68 }); 69});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.