diff --git a/packages/ui-maplibre/lib/Style/index.android.ts b/packages/ui-maplibre/lib/Style/index.android.ts index 5f18976..cd17b3f 100644 --- a/packages/ui-maplibre/lib/Style/index.android.ts +++ b/packages/ui-maplibre/lib/Style/index.android.ts @@ -1,7 +1,7 @@ import { ImageSource } from '@nativescript/core'; import { StyleCommon } from './common'; import { BaseSource, GeoJsonSource } from '../sources'; -import { BackgroundLayer, BaseLayer, CircleLayer, SymbolLayer } from '../layers'; +import { BackgroundLayer, BaseLayer, CircleLayer, LineLayer, SymbolLayer } from '../layers'; export class Style extends StyleCommon { public override addImage(name: string, source: ImageSource): void { @@ -66,6 +66,8 @@ export class Style extends StyleCommon { layer = BackgroundLayer.initWithNative(nLayer) as BackgroundLayer; } else if (nLayer instanceof org.maplibre.android.style.layers.CircleLayer) { layer = CircleLayer.initWithNative(nLayer) as CircleLayer; + } else if (nLayer instanceof org.maplibre.android.style.layers.LineLayer) { + layer = LineLayer.initWithNative(nLayer) as LineLayer; } else if (nLayer instanceof org.maplibre.android.style.layers.SymbolLayer) { layer = SymbolLayer.initWithNative(nLayer) as SymbolLayer; } else { diff --git a/packages/ui-maplibre/lib/Style/index.ios.ts b/packages/ui-maplibre/lib/Style/index.ios.ts index 75e8362..eab8d8c 100644 --- a/packages/ui-maplibre/lib/Style/index.ios.ts +++ b/packages/ui-maplibre/lib/Style/index.ios.ts @@ -1,7 +1,7 @@ import { ImageSource } from '@nativescript/core'; import { StyleCommon } from './common'; import { BaseSource, GeoJsonSource } from '../sources'; -import { BackgroundLayer, BaseLayer, CircleLayer, SymbolLayer } from '../layers'; +import { BackgroundLayer, BaseLayer, CircleLayer, LineLayer, SymbolLayer } from '../layers'; export class Style extends StyleCommon { public override addImage(name: string, source: ImageSource) { @@ -78,6 +78,8 @@ export class Style extends StyleCommon { layer = BackgroundLayer.initWithNative(nLayer) as BackgroundLayer; } else if (nLayer instanceof MLNCircleStyleLayer) { layer = CircleLayer.initWithNative(nLayer) as CircleLayer; + } else if (nLayer instanceof MLNLineStyleLayer) { + layer = LineLayer.initWithNative(nLayer) as LineLayer; } else if (nLayer instanceof MLNSymbolStyleLayer) { layer = SymbolLayer.initWithNative(nLayer) as SymbolLayer; } else { diff --git a/packages/ui-maplibre/lib/layers/LineLayer/common.ts b/packages/ui-maplibre/lib/layers/LineLayer/common.ts index f4f5d01..7a0ee5c 100644 --- a/packages/ui-maplibre/lib/layers/LineLayer/common.ts +++ b/packages/ui-maplibre/lib/layers/LineLayer/common.ts @@ -13,4 +13,9 @@ export abstract class LineLayerCommon extends AbstractVectorLayer) { this.setPropertyValueInternal('line-width', value); } + + @PaintProperty('line-opacity') + public set lineOpacity(value: PropertyValueSpecification) { + this.setPropertyValueInternal('line-opacity', value); + } } diff --git a/packages/ui-maplibre/lib/layers/LineLayer/index.android.ts b/packages/ui-maplibre/lib/layers/LineLayer/index.android.ts index 41041cd..1d6cf47 100644 --- a/packages/ui-maplibre/lib/layers/LineLayer/index.android.ts +++ b/packages/ui-maplibre/lib/layers/LineLayer/index.android.ts @@ -25,4 +25,12 @@ export class LineLayer extends LineLayerCommon this.native.getLineOpacity().value?.floatValue?.()); + } + + public override set lineOpacity(value) { + super.lineOpacity = value; + } } diff --git a/packages/ui-maplibre/lib/layers/LineLayer/index.d.ts b/packages/ui-maplibre/lib/layers/LineLayer/index.d.ts index 5817028..d927a52 100644 --- a/packages/ui-maplibre/lib/layers/LineLayer/index.d.ts +++ b/packages/ui-maplibre/lib/layers/LineLayer/index.d.ts @@ -6,6 +6,7 @@ import { LayerProperties } from '../BaseLayer'; export type LineLayerProperties = LayerProperties & { 'line-color': PropertyValueSpecification; 'line-width': PropertyValueSpecification; + 'line-opacity': PropertyValueSpecification; }; export declare class LineLayer extends AbstractVectorLayer { @@ -14,4 +15,6 @@ export declare class LineLayer extends AbstractVectorLayer); public get lineWidth(): PropertyValueSpecification; public set lineWidth(value: PropertyValueSpecification); + public get lineOpacity(): PropertyValueSpecification; + public set lineOpacity(value: PropertyValueSpecification); } diff --git a/packages/ui-maplibre/lib/layers/LineLayer/index.ios.ts b/packages/ui-maplibre/lib/layers/LineLayer/index.ios.ts index 39a9e39..9e164c7 100644 --- a/packages/ui-maplibre/lib/layers/LineLayer/index.ios.ts +++ b/packages/ui-maplibre/lib/layers/LineLayer/index.ios.ts @@ -34,4 +34,15 @@ export class LineLayer extends LineLayerCommon { super.lineWidth = value; this.native.lineWidth = expression?.native; } + + public override get lineOpacity() { + return this.getOrSetPropertyValueInternal('line-opacity', () => (Expression.initWithNative(this.native.lineOpacity) as Expression).toJSON()); + } + + public override set lineOpacity(value) { + const expression = Expression.propertyValue(value); + + super.lineOpacity = value; + this.native.lineOpacity = expression?.native; + } } diff --git a/packages/ui-maplibre/platforms/ios/Podfile b/packages/ui-maplibre/platforms/ios/Podfile index d987bc6..79b17be 100644 --- a/packages/ui-maplibre/platforms/ios/Podfile +++ b/packages/ui-maplibre/platforms/ios/Podfile @@ -1,3 +1,3 @@ platform :ios, '12.0' -pod 'MapLibre', '~> 6.19.1' \ No newline at end of file +pod 'MapLibre', '~> 6.23.0' \ No newline at end of file