Browse Source

Updated translations, added settings, added control for polyline

pull/14155/head
LeoMorgan113 11 months ago
parent
commit
344f219062
  1. 218
      ui-ngx/src/app/modules/home/components/widget/lib/maps/data-layer/polylines-data-layer.ts
  2. 17
      ui-ngx/src/app/modules/home/components/widget/lib/maps/data-layer/shapes-data-layer.ts
  3. 3
      ui-ngx/src/app/modules/home/components/widget/lib/maps/map.scss
  4. 24
      ui-ngx/src/app/modules/home/components/widget/lib/maps/map.ts
  5. 6
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-data-layer-dialog.component.html
  6. 32
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-data-layer-dialog.component.ts
  7. 1
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-data-layers.component.html
  8. 3
      ui-ngx/src/app/shared/models/widget/maps/map.models.ts
  9. 4
      ui-ngx/src/assets/help/en_US/widget/lib/map/path_point_color_fn.md
  10. 2
      ui-ngx/src/assets/help/en_US/widget/lib/map/path_point_tooltip_fn.md
  11. 24
      ui-ngx/src/assets/help/en_US/widget/lib/map/polyline_stroke_color_fn.md
  12. 2
      ui-ngx/src/assets/locale/locale.constant-en_US.json

218
ui-ngx/src/app/modules/home/components/widget/lib/maps/data-layer/polylines-data-layer.ts

@ -73,14 +73,13 @@ class TbPolylineDataLayerItem extends TbLatestDataLayerItem<PolylinesDataLayerSe
const polyData = this.dataLayer.extractPolylineCoordinates(data);
const polyConstructor = L.polyline;
this.polyline = polyConstructor(polyData as (TbPolylineRawCoordinates & L.LatLngTuple[]), {
// noClip: true,
// snapIgnore: !this.dataLayer.isSnappable(),
noClip: true,
snapIgnore: !this.dataLayer.isSnappable(),
bubblingMouseEvents: !this.dataLayer.isEditMode()
});
this.dataLayer.getShapeStyle(data, dsData, this.polylineStyleInfo?.patternId).subscribe((styleInfo) => {
this.dataLayer.getStrokeStyle(data, dsData, this.polylineStyleInfo?.patternId).subscribe((styleInfo) => {
this.polylineStyleInfo = styleInfo;
if (this.polyline) {
this.polyline.setStyle(this.polylineStyleInfo.style);
}
@ -103,7 +102,7 @@ class TbPolylineDataLayerItem extends TbLatestDataLayerItem<PolylinesDataLayerSe
}
protected doUpdate(data: FormattedData<TbMapDatasource>, dsData: FormattedData<TbMapDatasource>[]): void {
this.dataLayer.getShapeStyle(data, dsData, this.polylineStyleInfo?.patternId).subscribe((styleInfo) => {
this.dataLayer.getStrokeStyle(data, dsData, this.polylineStyleInfo?.patternId).subscribe((styleInfo) => {
this.polylineStyleInfo = styleInfo;
this.updatePolylineShape(data);
this.updateTooltip(data, dsData);
@ -159,36 +158,33 @@ class TbPolylineDataLayerItem extends TbLatestDataLayerItem<PolylinesDataLayerSe
protected onSelected(): L.TB.ToolbarButtonOptions[] {
const buttons: L.TB.ToolbarButtonOptions[] = [];
if (this.dataLayer.isEditEnabled()) {
// this.enablePolygonEditMode();
this.enablePolylineEditMode();
buttons.push(
{
id: 'cut',
title: this.getDataLayer().getCtx().translate.instant('widgets.maps.data-layer.polygon.cut'),
iconClass: 'tb-cut',
click: (e, button) => {
const map = this.dataLayer.getMap().getMap();
// if (!map.pm.globalCutModeEnabled()) {
// this.disablePolygonRotateMode();
// this.disablePolygonEditMode();
// this.enablePolygonCutMode(button);
// } else {
// this.disablePolygonCutMode(button);
// this.enablePolygonEditMode();
// }
}
},
// {
// id: 'cut',
// title: this.getDataLayer().getCtx().translate.instant('widgets.maps.data-layer.polygon.cut'),
// iconClass: 'tb-cut',
// click: (e, button) => {
// const map = this.dataLayer.getMap().getMap();
// if (!map.pm.globalCutModeEnabled()) {
// this.disablePolylineRotateMode();
// this.disablePolylineEditMode();
// } else {
// this.enablePolylineEditMode();
// }
// }
// },
{
id: 'rotate',
title: this.getDataLayer().getCtx().translate.instant('widgets.maps.data-layer.polygon.rotate'),
iconClass: 'tb-rotate',
click: (e, button) => {
if (!this.polyline.pm.rotateEnabled()) {
// this.disablePolygonCutMode();
// this.disablePolygonEditMode();
// this.enablePolygonRotateMode(button);
this.disablePolylineEditMode();
this.enablePolylineRotateMode(button);
} else {
// this.disablePolygonRotateMode(button);
// this.enablePolygonEditMode();
this.disablePolylineRotateMode(button);
this.enablePolylineEditMode();
}
}
}
@ -199,22 +195,15 @@ class TbPolylineDataLayerItem extends TbLatestDataLayerItem<PolylinesDataLayerSe
protected onDeselected(): void {
if (this.dataLayer.isEditEnabled()) {
// this.disablePolygonEditMode();
// this.disablePolygonCutMode();
// this.disablePolygonRotateMode();
this.disablePolylineEditMode();
this.disablePolylineRotateMode();
}
}
protected canDeselect(cancel = false): boolean {
const map = this.dataLayer.getMap().getMap();
if (map.pm.globalCutModeEnabled()) {
if (cancel) {
// this.disablePolygonCutMode();
}
return false;
} else if (this.polyline.pm.rotateEnabled()) {
if (this.polyline.pm.rotateEnabled()) {
if (cancel) {
// this.disablePolygonRotateMode();
this.disablePolylineRotateMode();
}
return false;
} else if (this.editing) {
@ -242,102 +231,36 @@ class TbPolylineDataLayerItem extends TbLatestDataLayerItem<PolylinesDataLayerSe
map.getEditToolbar().getButton('remove')?.setDisabled(false);
}
// private disablePolygonEditMode() {
// this.polyline.pm.disable();
// this.polyline.off('pm:markerdragstart');
// this.polyline.off('pm:markerdragend');
// this.polyline.off('pm:edit');
// const map = this.dataLayer.getMap();
// map.getEditToolbar().getButton('remove')?.setDisabled(true);
// }
// private enablePolygonCutMode(cutButton?: L.TB.ToolbarButton) {
// this.polylineContainer.closePopup();
// this.editing = true;
// this.polyline.options.bubblingMouseEvents = true;
// this.polyline.setStyle({...this.polylineStyleInfo.style, dashArray: '5 5', weight: 3,
// color: '#3388ff', opacity: 1, fillColor: '#3388ff', fillOpacity: 0.2});
// this.addItemClass('tb-cut-mode');
// this.polyline.once('pm:cut', (e) => {
// if (e.layer instanceof L.Polygon) {
// if (this.polyline instanceof L.Rectangle) {
// this.polylineContainer.removeLayer(this.polyline);
// this.polyline = L.polyline(e.layer.getLatLngs(), {
// ...this.polylineStyleInfo.style,
// snapIgnore: !this.dataLayer.isSnappable(),
// bubblingMouseEvents: !this.dataLayer.isEditMode()
// });
// this.polyline.addTo(this.polylineContainer);
// } else {
// this.polyline.setLatLngs(e.layer.getLatLngs());
// }
// }
// // @ts-ignore
// e.layer._pmTempLayer = true;
// e.layer.remove();
// this.polylineContainer.removeLayer(this.polyline);
// // @ts-ignore
// this.polyline._pmTempLayer = false;
// this.polyline.addTo(this.polylineContainer);
// this.updateSelectedState();
// cutButton?.setActive(false);
// this.savePolygonCoordinates()
// });
// const map = this.dataLayer.getMap().getMap();
// map.pm.setLang('en', {
// tooltips: {
// firstVertex: this.getDataLayer().getCtx().translate.instant('widgets.maps.data-layer.polygon.polygon-place-first-point-cut-hint'),
// continueLine: this.getDataLayer().getCtx().translate.instant('widgets.maps.data-layer.polygon.continue-polygon-cut-hint'),
// finishPoly: this.getDataLayer().getCtx().translate.instant('widgets.maps.data-layer.polygon.finish-polygon-cut-hint')
// }
// }, 'en');
// map.pm.enableGlobalCutMode({
// // @ts-ignore
// layersToCut: [this.polyline]
// });
// // @ts-ignore
// L.DomUtil.addClass(map.pm.Draw.Cut._hintMarker.getTooltip()._container, 'tb-place-item-label');
// cutButton?.setActive(true);
// map.once('pm:globalcutmodetoggled', (e) => {
// // if (!e.enabled) {
// // this.disablePolygonCutMode(cutButton);
// // this.enablePolygonEditMode();
// // }
// });
// }
// private disablePolygonCutMode(cutButton?: L.TB.ToolbarButton) {
// this.editing = false;
// this.polyline.options.bubblingMouseEvents = !this.dataLayer.isEditMode();
// this.polyline.setStyle({...this.polylineStyleInfo.style, dashArray: null});
// this.removeItemClass('tb-cut-mode');
// this.polyline.off('pm:cut');
// const map = this.dataLayer.getMap().getMap();
// map.pm.disableGlobalCutMode();
// cutButton?.setActive(false);
// }
// private enablePolygonRotateMode(rotateButton?: L.TB.ToolbarButton) {
// this.polylineContainer.closePopup();
// this.editing = true;
// this.polyline.on('pm:rotateend', () => {
// this.savePolygonCoordinates();
// });
// this.polyline.pm.enableRotate();
// rotateButton?.setActive(true);
// this.polyline.on('pm:rotatedisable', () => {
// this.disablePolygonRotateMode(rotateButton);
// this.enablePolygonEditMode();
// });
// }
//
// private disablePolygonRotateMode(rotateButton?: L.TB.ToolbarButton) {
// this.editing = false;
// this.polyline.pm.disableRotate();
// this.polyline.off('pm:rotateend');
// this.polyline.off('pm:rotatedisable');
// rotateButton?.setActive(false);
// }
private disablePolylineEditMode() {
this.polyline.pm.disable();
this.polyline.off('pm:markerdragstart');
this.polyline.off('pm:markerdragend');
this.polyline.off('pm:edit');
const map = this.dataLayer.getMap();
map.getEditToolbar().getButton('remove')?.setDisabled(true);
}
private enablePolylineRotateMode(rotateButton?: L.TB.ToolbarButton) {
this.polylineContainer.closePopup();
this.editing = true;
this.polyline.on('pm:rotateend', () => {
this.savePolylineCoordinates();
});
this.polyline.pm.enableRotate();
rotateButton?.setActive(true);
this.polyline.on('pm:rotatedisable', () => {
this.disablePolylineRotateMode(rotateButton);
this.enablePolylineEditMode();
});
}
private disablePolylineRotateMode(rotateButton?: L.TB.ToolbarButton) {
this.editing = false;
this.polyline.pm.disableRotate();
this.polyline.off('pm:rotateend');
this.polyline.off('pm:rotatedisable');
rotateButton?.setActive(false);
}
private savePolylineCoordinates() {
let coordinates: TbPolylineCoordinates = this.polyline.getLatLngs();
@ -361,20 +284,20 @@ class TbPolylineDataLayerItem extends TbLatestDataLayerItem<PolylinesDataLayerSe
const polyData = this.dataLayer.extractPolylineCoordinates(data) as TbPolylineData;
if (isCutPolygon(polyData) || polyData.length !== 2) {
if (this.polyline instanceof L.Rectangle) {
this.polylineContainer.removeLayer(this.polyline);
this.polyline = L.polyline(polyData, {
...this.polylineStyleInfo.style,
snapIgnore: !this.dataLayer.isSnappable(),
bubblingMouseEvents: !this.dataLayer.isEditMode(),
noClip: true
});
this.polyline.addTo(this.polylineContainer);
this.editModeUpdated();
} else {
// if (this.polyline instanceof L.Rectangle) {
//
// this.polylineContainer.removeLayer(this.polyline);
// this.polyline = L.polyline(polyData, {
// ...this.polylineStyleInfo.style,
// snapIgnore: !this.dataLayer.isSnappable(),
// bubblingMouseEvents: !this.dataLayer.isEditMode(),
// noClip: true
// });
// this.polyline.addTo(this.polylineContainer);
// this.editModeUpdated();
// } else {
this.polyline.setLatLngs(polyData);
}
// }
} else if (polyData.length === 2) {
const bounds = new L.LatLngBounds(polyData as L.LatLngTuple[]);
// (this.polyline as L.Rectangle).setBounds(bounds);
@ -458,5 +381,4 @@ export class TbPolylineDataLayer extends TbShapesDataLayer<PolylinesDataLayerSet
protected createLayerItem(data: FormattedData<TbMapDatasource>, dsData: FormattedData<TbMapDatasource>[]): TbPolylineDataLayerItem {
return new TbPolylineDataLayerItem(data, dsData, this.settings, this);
}
}

17
ui-ngx/src/app/modules/home/components/widget/lib/maps/data-layer/shapes-data-layer.ts

@ -311,6 +311,23 @@ export abstract class TbShapesDataLayer<S extends ShapeDataLayerSettings, L exte
super(map, inputSettings);
}
public getStrokeStyle(data: FormattedData<TbMapDatasource>, dsData: FormattedData<TbMapDatasource>[], fillPatternId: string): Observable<ShapeStyleInfo> {
return this.shapePatternProcessor.processPattern(data, dsData, fillPatternId).pipe(
map((patternWithId) => {
const stroke = this.strokeColorProcessor.processColor(data, dsData);
const style: L.PathOptions = {
color: stroke,
weight: this.settings.strokeWeight,
opacity: 1
};
return {
patternId: patternWithId.patternId,
style
}
})
);
}
public getShapeStyle(data: FormattedData<TbMapDatasource>, dsData: FormattedData<TbMapDatasource>[], fillPatternId: string): Observable<ShapeStyleInfo> {
return this.shapePatternProcessor.processPattern(data, dsData, fillPatternId).pipe(
map((patternWithId) => {

3
ui-ngx/src/app/modules/home/components/widget/lib/maps/map.scss

@ -169,6 +169,9 @@ div.tb-widget .tb-widget-content.tb-no-interaction {
&.tb-draw-circle {
mask-image: url('data:image/svg+xml,<svg width="18" height="18" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"><path d="M16.5 6.75H14.9775C14.025 4.0575 11.4825 2.25 8.625 2.25C6.83479 2.25 5.1179 2.96116 3.85203 4.22703C2.58616 5.4929 1.875 7.20979 1.875 9C1.875 12.75 4.8975 15.75 8.625 15.75C11.4825 15.75 14.025 13.95 15 11.25H16.5M15 8.25V9.75H13.5V8.25M13.365 11.25C12.495 13.08 10.65 14.25 8.625 14.25C5.73 14.25 3.375 11.9025 3.375 9C3.375 6.105 5.73 3.75 8.625 3.75C10.65 3.75 12.495 4.9275 13.3575 6.75H12V11.25"/></svg>');
}
&.tb-draw-polyline {
mask-image: url('data:image/svg+xml,<svg height="18px" viewBox="0 -960 960 960" width="18px" xmlns="http://www.w3.org/2000/svg"><path d="M600-96v-86L317-336H144v-216h152l112-132v-180h216v216H472L360-516v121l240 131v-48h216v216H600ZM480-720h72v-72h-72v72ZM216-408h72v-72h-72v72Zm456 240h72v-72h-72v72ZM516-755ZM252-444Zm455 240Z"/></svg>');
}
&.tb-close {
background: #D12730;
mask-image: url('data:image/svg+xml,<svg width="20" height="20" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"><path d="M14.25 4.8075L13.1925 3.75L9 7.9425L4.8075 3.75L3.75 4.8075L7.9425 9L3.75 13.1925L4.8075 14.25L9 10.0575L13.1925 14.25L14.25 13.1925L10.0575 9L14.25 4.8075Z"/></svg>');

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

@ -125,6 +125,7 @@ export abstract class TbMap<S extends BaseMapSettings> {
protected addRectangleButton: L.TB.ToolbarButton;
protected addPolygonButton: L.TB.ToolbarButton;
protected addCircleButton: L.TB.ToolbarButton;
protected addPolylineButton: L.TB.ToolbarButton;
protected timeLineComponentRef: ComponentRef<MapTimelinePanelComponent>;
protected timeLineComponent: MapTimelinePanelComponent;
@ -133,6 +134,7 @@ export abstract class TbMap<S extends BaseMapSettings> {
protected addMarkerDataLayers: TbLatestMapDataLayer<any>[];
protected addPolygonDataLayers: TbLatestMapDataLayer<any>[];
protected addCircleDataLayers: TbLatestMapDataLayer<any>[];
protected addPolylineDataLayers: TbLatestMapDataLayer<any>[];
protected shapePatternStorage: ShapePatternStorage = {};
@ -506,6 +508,18 @@ export abstract class TbMap<S extends BaseMapSettings> {
});
this.addCircleButton.setDisabled(true);
}
this.addPolylineDataLayers = addSupportedDataLayers.filter(dl => dl.dataLayerType() === 'polylines');
if (this.addPolylineDataLayers.length) {
this.addPolylineButton = drawToolbar.toolbarButton({
id: 'addPolyline',
title: this.ctx.translate.instant('widgets.maps.data-layer.polyline.draw-polyline'),
iconClass: 'tb-draw-polyline',
click: (e, button) => {
this.drawPolyline(e, button);
}
});
this.addPolylineButton.setDisabled(true);
}
}
}
@ -563,6 +577,13 @@ export abstract class TbMap<S extends BaseMapSettings> {
}));
}
private drawPolyline(e: MouseEvent, button: L.TB.ToolbarButton): void {
this.placeItem(e, button, this.addCircleDataLayers, (entity) => this.prepareDrawMode('Polyline', {
firstVertex: this.ctx.translate.instant('widgets.maps.data-layer.polyline.polyline-place-first-point-hint-with-entity', {entityName: entity.entity.entityDisplayName}),
continueLine: this.ctx.translate.instant('widgets.maps.data-layer.polyline.continue-polyline-hint-with-entity', {entityName: entity.entity.entityDisplayName}),
}));
}
private placeItem(e: MouseEvent, button: L.TB.ToolbarButton, dataLayers: TbLatestMapDataLayer[],
prepareDrawMode: (entity: UnplacedMapDataItem) => void): void {
if (this.isPlacingItem) {
@ -684,6 +705,9 @@ export abstract class TbMap<S extends BaseMapSettings> {
case MapItemType.circle:
this.createCircle(actionData);
break;
case MapItemType.polyline:
// this.createPolyline(actionData); // TODO
break;
}
}

6
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-data-layer-dialog.component.html

@ -465,6 +465,8 @@
<tb-shape-fill-image-settings formControlName="fillImage"></tb-shape-fill-image-settings>
</div>
</div>
</ng-container>
<ng-container *ngIf="['polygons', 'circles', 'polylines'].includes(dataLayerType)">
<div class="tb-form-row space-between">
<div translate>widgets.maps.data-layer.shape.stroke</div>
<div class="flex flex-row items-center gap-2">
@ -477,7 +479,9 @@
[dsType]="dataLayerFormGroup.get('dsType').value"
[dsEntityAliasId]="dataLayerFormGroup.get('dsEntityAliasId').value"
[dsDeviceId]="dataLayerFormGroup.get('dsDeviceId').value"
helpId="{{ dataLayerType === 'polygons' ? 'widget/lib/map/polygon_stroke_color_fn' : 'widget/lib/map/circle_stroke_color_fn' }}" formControlName="strokeColor"></tb-data-layer-color-settings>
helpId="{{ dataLayerType === 'polygons' ? 'widget/lib/map/polygon_stroke_color_fn' :
(dataLayerType === 'circles' ? 'widget/lib/map/polygon_stroke_color_fn' : 'widget/lib/map/polyline_stroke_color_fn') }}"
formControlName="strokeColor"></tb-data-layer-color-settings>
</div>
</div>
</ng-container>

32
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-data-layer-dialog.component.ts

@ -474,23 +474,23 @@ export class MapDataLayerDialogComponent extends DialogComponent<MapDataLayerDia
this.dataLayerFormGroup.get('pointTooltip').disable({emitEvent: false});
}
} else if (this.dataLayerType === 'polylines') {
const usePathDecorator: boolean = this.dataLayerFormGroup.get('usePathDecorator').value;
// const usePathDecorator: boolean = this.dataLayerFormGroup.get('usePathDecorator').value;
const showPoints: boolean = this.dataLayerFormGroup.get('showPoints').value;
if (usePathDecorator) {
this.dataLayerFormGroup.get('pathDecoratorSymbol').enable({emitEvent: false});
this.dataLayerFormGroup.get('pathDecoratorSymbolSize').enable({emitEvent: false});
this.dataLayerFormGroup.get('pathDecoratorSymbolColor').enable({emitEvent: false});
this.dataLayerFormGroup.get('pathDecoratorOffset').enable({emitEvent: false});
this.dataLayerFormGroup.get('pathEndDecoratorOffset').enable({emitEvent: false});
this.dataLayerFormGroup.get('pathDecoratorRepeat').enable({emitEvent: false});
} else {
this.dataLayerFormGroup.get('pathDecoratorSymbol').disable({emitEvent: false});
this.dataLayerFormGroup.get('pathDecoratorSymbolSize').disable({emitEvent: false});
this.dataLayerFormGroup.get('pathDecoratorSymbolColor').disable({emitEvent: false});
this.dataLayerFormGroup.get('pathDecoratorOffset').disable({emitEvent: false});
this.dataLayerFormGroup.get('pathEndDecoratorOffset').disable({emitEvent: false});
this.dataLayerFormGroup.get('pathDecoratorRepeat').disable({emitEvent: false});
}
// if (usePathDecorator) {
// this.dataLayerFormGroup.get('pathDecoratorSymbol').enable({emitEvent: false});
// this.dataLayerFormGroup.get('pathDecoratorSymbolSize').enable({emitEvent: false});
// this.dataLayerFormGroup.get('pathDecoratorSymbolColor').enable({emitEvent: false});
// this.dataLayerFormGroup.get('pathDecoratorOffset').enable({emitEvent: false});
// this.dataLayerFormGroup.get('pathEndDecoratorOffset').enable({emitEvent: false});
// this.dataLayerFormGroup.get('pathDecoratorRepeat').enable({emitEvent: false});
// } else {
// this.dataLayerFormGroup.get('pathDecoratorSymbol').disable({emitEvent: false});
// this.dataLayerFormGroup.get('pathDecoratorSymbolSize').disable({emitEvent: false});
// this.dataLayerFormGroup.get('pathDecoratorSymbolColor').disable({emitEvent: false});
// this.dataLayerFormGroup.get('pathDecoratorOffset').disable({emitEvent: false});
// this.dataLayerFormGroup.get('pathEndDecoratorOffset').disable({emitEvent: false});
// this.dataLayerFormGroup.get('pathDecoratorRepeat').disable({emitEvent: false});
// }
if (showPoints) {
this.dataLayerFormGroup.get('pointSize').enable({emitEvent: false});
this.dataLayerFormGroup.get('pointColor').enable({emitEvent: false});

1
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-data-layers.component.html

@ -27,6 +27,7 @@
</div>
<div *ngIf="dataLayerType === 'polygons'" class="tb-form-table-header-cell tb-key-header" translate>widgets.maps.data-layer.polygon.polygon-key</div>
<div *ngIf="dataLayerType === 'circles'" class="tb-form-table-header-cell tb-key-header" translate>widgets.maps.data-layer.circle.circle-key</div>
<div *ngIf="dataLayerType === 'polylines'" class="tb-form-table-header-cell tb-key-header" translate>widgets.maps.data-layer.polyline.polyline-key</div>
<div class="tb-form-table-header-cell tb-actions-header"></div>
</div>
<div *ngIf="dataLayersFormArray().controls.length; else noDataLayers" class="tb-form-table-body">

3
ui-ngx/src/app/shared/models/widget/maps/map.models.ts

@ -687,6 +687,7 @@ export const defaultBasePolylinesDataLayerSettings = (mapType: MapType): Partial
type: DataLayerColorType.constant,
color: '#3388ff',
},
strokeWeight: 3,
// usePathDecorator: false,
// pathDecoratorSymbol: PathDecoratorSymbol.arrowHead,
// pathDecoratorSymbolSize: 10,
@ -701,7 +702,7 @@ export const defaultBasePolylinesDataLayerSettings = (mapType: MapType): Partial
color: '#307FE5',
},
pointTooltip: {
show: true,
show: false,
trigger: DataLayerTooltipTrigger.click,
autoclose: true,
type: DataLayerPatternType.pattern,

4
ui-ngx/src/assets/help/en_US/widget/lib/map/path_point_color_fn.md

@ -5,7 +5,7 @@
*function (data, dsData): string*
A JavaScript function used to compute color of the trip path point.
A JavaScript function used to compute color of the path point.
**Parameters:**
@ -15,7 +15,7 @@ A JavaScript function used to compute color of the trip path point.
**Returns:**
Should return string value presenting color of the trip path point.
Should return string value presenting color of the path point.
In case no data is returned, color value from **Color** settings field will be used.

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

@ -5,7 +5,7 @@
*function (data, dsData): string*
A JavaScript function used to compute text or HTML code to be displayed in the trip path point tooltip.
A JavaScript function used to compute text or HTML code to be displayed in the path point tooltip.
**Parameters:**

24
ui-ngx/src/assets/help/en_US/widget/lib/map/polyline_stroke_color_fn.md

@ -0,0 +1,24 @@
#### Polyline stroke color function
<div class="divider"></div>
<br/>
*function (data, dsData): string*
A JavaScript function used to compute stroke color of the polyline.
**Parameters:**
<ul>
{% include widget/lib/map/map_fn_args %}
</ul>
**Returns:**
Should return string value presenting stroke color of the polyline.
In case no data is returned, color value from **Color** settings field will be used.
<div class="divider"></div>
{% include widget/lib/map/color_fn_examples %}

2
ui-ngx/src/assets/locale/locale.constant-en_US.json

@ -8640,6 +8640,8 @@
"edit": "Edit polyline",
"remove-polyline-for": "Remove polyline for '{{entityName}}'",
"draw-polyline": "Draw polyline",
"polyline-place-first-point-hint": "Polyline: click to place first point",
"continue-polyline-hint-with-entity": "Polyline for '{{entityName}}': click to continue drawing",
"finish-polyline-hint": "Polyline: click to finish drawing"
},
"select-entity": "Select entity",

Loading…
Cancel
Save