- var t = self.options.popupText;
- L.circleMarker(self._event.latlng, self.options.markerStyle)
- .bindPopup(t[0] + distance + " " + unit + t[1])
- .addTo(self._layer);
+ var m;
+ if (self._following) {
+ m = self.options.followMarkerStyle;
+ } else {
+ m = self.options.markerStyle;
+ }
+
+ var t = self.options.strings.popup;
+ if (!self._circleMarker) {
+ self._circleMarker = L.circleMarker(self._event.latlng, m)
+ .bindPopup(L.Util.template(t, {distance: distance, unit: unit}))
+ .addTo(self._layer);
+ } else {
+ self._circleMarker.setLatLng(self._event.latlng)
+ .bindPopup(L.Util.template(t, {distance: distance, unit: unit}))
+ ._popup.setLatLng(self._event.latlng);
+ }