Browse Source

UI: Refactoring for coments

pull/7311/head
Artem Dzhereleiko 4 years ago
parent
commit
1ff382413d
  1. 1
      ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts
  2. 9
      ui-ngx/src/app/modules/home/components/widget/lib/maps/markers.ts
  3. 2
      ui-ngx/src/assets/help/en_US/widget/lib/map/clustering_color_fn.md

1
ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts

@ -923,7 +923,6 @@ export default abstract class LeafletMap {
if (settings.showTooltip) {
marker.updateMarkerTooltip(data);
}
marker.updateMarkerData(data);
marker.updateMarkerIcon(settings);
return marker;
}

9
ui-ngx/src/app/modules/home/components/widget/lib/maps/markers.ts

@ -90,8 +90,9 @@ export class Marker {
}
setDataSources(data: FormattedData, dataSources: FormattedData[]) {
this.data = data;
this.dataSources = dataSources;
this.data = data;
this.dataSources = dataSources;
this.leafletMarker.options.tbMarkerData = data;
}
updateMarkerTooltip(data: FormattedData) {
@ -107,10 +108,6 @@ export class Marker {
}
}
updateMarkerData(data: FormattedData) {
this.leafletMarker.options.tbMarkerData = data;
}
updateMarkerPosition(position: L.LatLng) {
if (!this.leafletMarker.getLatLng().equals(position) && !this.editing) {
this.location = position;

2
ui-ngx/src/assets/help/en_US/widget/lib/map/clustering_color_fn.md

@ -10,7 +10,7 @@ A JavaScript function used to compute clustering marker color.
**Parameters:**
<ul>
<li><b>data:</b> <code><a href="https://github.com/thingsboard/thingsboard/blob/5bb6403407aa4898084832d6698aa9ea6d484889/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-models.ts#L108" target="_blank">FormattedData</a></code> - A <a href="https://github.com/thingsboard/thingsboard/blob/5bb6403407aa4898084832d6698aa9ea6d484889/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-models.ts#L108" target="_blank">FormattedData</a> object associated with marker or data point of the route.<br/>
<li><b>data:</b> Array<<code><a href="https://github.com/thingsboard/thingsboard/blob/5bb6403407aa4898084832d6698aa9ea6d484889/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-models.ts#L108" target="_blank">FormattedData</a></code>> - A <a href="https://github.com/thingsboard/thingsboard/blob/5bb6403407aa4898084832d6698aa9ea6d484889/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-models.ts#L108" target="_blank">FormattedData</a> object associated with marker or data point of the route.<br/>
Represents basic entity properties (ex. <code>entityId</code>, <code>entityName</code>)<br/>and provides access to other entity attributes/timeseries declared in widget datasource configuration.
</li>
<li><b>childCount:</b> <code>number</code> - number of markers in this cluster

Loading…
Cancel
Save