Conditions | 1 |
Paths | 1 |
Total Lines | 32 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | define(['leaflet'], function (L) { |
||
2 | 'use strict'; |
||
3 | |||
4 | return L.CircleMarker.extend({ |
||
5 | initialize: function (latlng) { |
||
6 | this.accuracyCircle = L.circle(latlng, 0, config.locate.accuracyCircle); |
||
7 | this.outerCircle = L.circleMarker(latlng, config.locate.outerCircle); |
||
8 | L.CircleMarker.prototype.initialize.call(this, latlng, config.locate.innerCircle); |
||
9 | |||
10 | this.on('remove', function () { |
||
11 | this._map.removeLayer(this.accuracyCircle); |
||
12 | this._map.removeLayer(this.outerCircle); |
||
13 | }); |
||
14 | }, |
||
15 | |||
16 | setLatLng: function (latlng) { |
||
17 | this.accuracyCircle.setLatLng(latlng); |
||
18 | this.outerCircle.setLatLng(latlng); |
||
19 | L.CircleMarker.prototype.setLatLng.call(this, latlng); |
||
20 | }, |
||
21 | |||
22 | setAccuracy: function (accuracy) { |
||
23 | this.accuracyCircle.setRadius(accuracy); |
||
24 | }, |
||
25 | |||
26 | onAdd: function (map) { |
||
27 | this.accuracyCircle.addTo(map).bringToBack(); |
||
28 | this.outerCircle.addTo(map); |
||
29 | L.CircleMarker.prototype.onAdd.call(this, map); |
||
30 | } |
||
31 | }); |
||
32 | }); |
||
33 |