Skip to content

Commit b70341e

Browse files
committed
chore: demo update
1 parent 6b1f5ca commit b70341e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

demo-snippets/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"private": true,
44
"version": "0.0.1",
55
"dependencies": {
6-
"@nativescript-community/ui-carto": "file:../packages/ui-carto",
6+
"@nativescript-community/ui-carto": "*",
77
"vue-property-decorator": "9.1.2"
88
}
99
}

demo-snippets/svelte/BasicRaster.svelte

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import { RasterTileLayer } from '@nativescript-community/ui-carto/layers/raster';
55
import { VectorLayer } from '@nativescript-community/ui-carto/layers/vector';
66
import { CartoMap } from '@nativescript-community/ui-carto/ui';
7-
import { PanningMode } from '@nativescript-community/ui-carto/ui/index.android';
7+
import { PanningMode } from '@nativescript-community/ui-carto/ui';
88
import { setShowDebug, setShowError, setShowInfo, setShowWarn } from '@nativescript-community/ui-carto/utils';
99
import { Line, LineEndType, LineJointType, LineStyleBuilder } from '@nativescript-community/ui-carto/vectorelements/line';
1010
import { Marker, MarkerStyleBuilder } from '@nativescript-community/ui-carto/vectorelements/marker';
@@ -14,8 +14,13 @@ import { PanningMode } from '@nativescript-community/ui-carto/ui/index.android';
1414
let cartoMap: CartoMap;
1515
let rasterLayer: RasterTileLayer;
1616
17+
function logEvent(e) {
18+
console.log(e.eventName, Object.keys(e))
19+
}
20+
1721
function onMainMapReady(e) {
1822
cartoMap = e.object as CartoMap;
23+
console.log('onMainMapReady');
1924
const options = cartoMap.getOptions();
2025
options.setWatermarkScale(0);
2126
options.setRestrictedPanning(true);
@@ -112,6 +117,6 @@ import { PanningMode } from '@nativescript-community/ui-carto/ui/index.android';
112117
<navigationButton text="Go back" on:tap={() => goBack()} />
113118
</actionBar>
114119
<gridLayout class="page">
115-
<cartomap zoom="10" on:mapReady={onMainMapReady} />
120+
<cartomap zoom="10" on:mapReady={onMainMapReady} on:mapMove={logEvent} on:mapStable={logEvent} on:mapIdle={logEvent} on:mapClicked={logEvent} on:mapInteraction={logEvent}/>
116121
</gridLayout>
117122
</page>

0 commit comments

Comments
 (0)