Skip to content

Commit b41d015

Browse files
committed
test: demo to N 7
1 parent 5a95b2f commit b41d015

17 files changed

+1828
-1609
lines changed

demo_vue/app/App.vue

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,109 +27,109 @@ const samples = [
2727
component: 'BaseMaps',
2828
title: 'Online Base Maps',
2929
description: 'Choice between different base maps, styles, languages',
30-
image: '~/assets/images/image_base_maps.png'
30+
image: '~/assets/images/image_base_maps.png',
3131
},
3232
{
3333
component: 'CustomDev',
3434
title: 'Dev example',
35-
description: 'live dev example'
35+
description: 'live dev example',
3636
},
3737
{
3838
component: 'ReverseGeocoding',
3939
title: 'Reverse Geocoding',
4040
description: 'Coding of a point location to a readable address',
41-
image: '~/assets/images/icon_sample_reverse_geocoding.png'
41+
image: '~/assets/images/icon_sample_reverse_geocoding.png',
4242
},
4343
{
4444
component: 'Geocoding',
4545
title: 'Geocoding',
4646
description: 'Converting addresses into geographic coordinates',
47-
image: '~/assets/images/icon_sample_geocoding.png'
47+
image: '~/assets/images/icon_sample_geocoding.png',
4848
},
4949
{
5050
component: 'CustomRasterDatasource',
5151
title: 'Custom Raster Data',
5252
description: 'Customized raster tile data source',
53-
image: '~/assets/images/image_custom_raster.png'
53+
image: '~/assets/images/image_custom_raster.png',
5454
},
5555
{
5656
component: 'RouteSearch',
5757
title: 'Search API',
5858
description: 'Finds points of interest near a route',
59-
image: '~/assets/images/icon_sample_route_search.png'
59+
image: '~/assets/images/icon_sample_route_search.png',
6060
},
6161
{
6262
component: 'GroundOverlay',
6363
title: 'Ground Overlays',
6464
description: 'Shows a non-tiled Bitmap on ground',
65-
image: '~/assets/images/image_ground_overlays.png'
65+
image: '~/assets/images/image_ground_overlays.png',
6666
},
6767
{
6868
component: 'WmsMap',
6969
title: 'WMS Map',
7070
description: 'Use external WMS service for raster tile overlay',
71-
image: '~/assets/images/image_wms.png'
71+
image: '~/assets/images/image_wms.png',
7272
},
7373
{
7474
component: 'OfflineRouting',
7575
title: 'Routing',
7676
description: 'Valhalla Routing and Route Package download',
77-
image: '~/assets/images/image_offline_routing.png'
77+
image: '~/assets/images/image_offline_routing.png',
7878
},
7979
{
8080
component: 'VectorObjectEditing',
8181
title: 'Vector Object Editing',
8282
description: 'Shows usage of an editable vector layer',
83-
image: '~/assets/images/image_object_editing.png'
83+
image: '~/assets/images/image_object_editing.png',
8484
},
8585
{
8686
component: 'Overlays',
8787
title: '2D & 3D Overlays',
8888
description: 'Shows lines, points, polygons, texts, pop-ups and a NMLModel',
89-
image: '~/assets/images/image_overlays.png'
89+
image: '~/assets/images/image_overlays.png',
9090
},
9191
{
9292
component: 'ClusteredMarkers',
9393
title: 'Clustered Markers',
9494
description: 'Shows 20,000 points from bundled geojson',
95-
image: '~/assets/images/image_clustered_markers.png'
95+
image: '~/assets/images/image_clustered_markers.png',
9696
},
9797
{
9898
component: 'BundledMap',
9999
title: 'Bundled Map',
100100
description: 'Offline map of Rome bundled with the app',
101-
image: '~/assets/images/image_bundled.png'
101+
image: '~/assets/images/image_bundled.png',
102102
},
103103
{
104104
component: 'OfflineMap',
105105
title: 'Offline Map',
106106
description: 'Map package download',
107-
image: '~/assets/images/image_city_package.png'
107+
image: '~/assets/images/image_city_package.png',
108108
},
109109
{
110110
component: 'Capture',
111111
title: 'Screencapture',
112112
description: 'Capture rendered mapView as a Bitmap',
113-
image: '~/assets/images/image_screencapture.png'
113+
image: '~/assets/images/image_screencapture.png',
114114
},
115115
{
116116
component: 'CustomPopup',
117117
title: 'Custom Popup',
118118
description: 'Creates a Custom Popup',
119-
image: '~/assets/images/image_custom_popup.png'
119+
image: '~/assets/images/image_custom_popup.png',
120120
},
121121
{
122122
component: 'GpsLocation',
123123
title: 'GPS Location',
124124
description: 'Shows user GPS location on the map',
125-
image: '~/assets/images/image_gps_location.png'
125+
image: '~/assets/images/image_gps_location.png',
126126
},
127127
{
128128
component: 'BundledPackageData',
129129
title: 'Package Data',
130130
description: 'Displays available CARTO Mobile packages',
131-
image: '~/assets/images/icon_sample_user_data.png'
132-
}
131+
image: '~/assets/images/icon_sample_user_data.png',
132+
},
133133
];
134134
@Component({})
135135
export default class App extends BaseVueComponent {
@@ -145,8 +145,8 @@ export default class App extends BaseVueComponent {
145145
this.$navigateTo(module, {
146146
props: {
147147
title: item.title,
148-
description: item.description
149-
}
148+
description: item.description,
149+
},
150150
} as any);
151151
}
152152
}
File renamed without changes.

demo_vue/app/examples/BaseMaps.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default class BaseMaps extends BaseVueComponent {
4949
if (this.currentLayer) {
5050
if (this.currentLayer instanceof CartoOnlineVectorTileLayer) {
5151
console.log('clearing listener');
52-
(this.currentLayer as CartoOnlineVectorTileLayer).setVectorTileEventListener(null);
52+
this.currentLayer.setVectorTileEventListener(null);
5353
}
5454
mapView.removeLayer(this.currentLayer);
5555
this.currentLayer = null;
@@ -59,27 +59,27 @@ export default class BaseMaps extends BaseVueComponent {
5959
switch (id) {
6060
case 'voyager':
6161
this.currentLayer = new CartoOnlineVectorTileLayer({
62-
style: CartoMapStyle.VOYAGER
62+
style: CartoMapStyle.VOYAGER,
6363
});
6464
break;
6565
case 'positron':
6666
this.currentLayer = new CartoOnlineVectorTileLayer({
67-
style: CartoMapStyle.POSITRON
67+
style: CartoMapStyle.POSITRON,
6868
});
6969
break;
7070
case 'darkmatter':
7171
this.currentLayer = new CartoOnlineVectorTileLayer({
72-
style: CartoMapStyle.DARKMATTER
72+
style: CartoMapStyle.DARKMATTER,
7373
});
7474
break;
7575
default: {
7676
this.currentLayer = new CartoOnlineRasterTileLayer({
77-
source: id + '@2x'
77+
source: id + '@2x',
7878
});
7979
}
8080
}
8181
if (this.currentLayer instanceof CartoOnlineVectorTileLayer) {
82-
(this.currentLayer as CartoOnlineVectorTileLayer).setVectorTileEventListener(this, mapView.projection);
82+
this.currentLayer.setVectorTileEventListener(this, mapView.projection);
8383
}
8484

8585
mapView.addLayer(this.currentLayer);
@@ -99,17 +99,17 @@ export default class BaseMaps extends BaseVueComponent {
9999
action({
100100
title: 'Layer',
101101
message: 'Select Layer',
102-
actions: this.layerTypes
103-
}).then(result => {
102+
actions: this.layerTypes,
103+
}).then((result) => {
104104
result && this.setCurrentLayer(result);
105105
});
106106
}
107107
onSelectLanguage() {
108108
action({
109109
title: 'Language',
110110
message: 'Select Language',
111-
actions: this.languages
112-
}).then(result => {
111+
actions: this.languages,
112+
}).then((result) => {
113113
result && this.updateLanguage(result);
114114
});
115115
}

demo_vue/app/examples/BaseVueComponent.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import Vue from 'nativescript-vue';
22
import { Page } from '@nativescript/core/ui/page';
3-
import { isAndroid, isIOS } from '@nativescript/core/platform/platform';
43
import { CartoMap } from 'nativescript-carto/ui';
54

65
export default class BaseVueComponent extends Vue {
7-
public isAndroid = isAndroid;
8-
public isIOS = isIOS;
96
get page() {
107
return (this.$refs.page as any).nativeView as Page;
118
}

demo_vue/app/examples/ClusteredMarkers.vue

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { CartoMapStyle, MapPos } from 'nativescript-carto/core';
2121
import { CartoMap, MapStableEvent } from 'nativescript-carto/ui';
2222
import { CartoOnlineRasterTileLayer } from 'nativescript-carto/layers/raster';
2323
import { action } from '@nativescript/core/ui/dialogs';
24-
import { Folder, knownFolders, path } from '@nativescript/core/file-system/file-system';
24+
import { Folder, knownFolders, path } from '@nativescript/core/file-system';
2525
import { ClusterElementBuilder } from 'nativescript-carto/layers/cluster';
2626
import { GeoJSONGeometryReader } from 'nativescript-carto/geometry/geojsonreader';
2727
import { MarkerStyleBuilder, Marker } from 'nativescript-carto/vectorelements/marker';
@@ -69,7 +69,7 @@ export default class Example extends BaseMaps {
6969
console.log('read geojson');
7070
const styleBuilder = new MarkerStyleBuilder({
7171
size: 14,
72-
bitmap: '~/assets/images/marker_black.png'
72+
bitmap: '~/assets/images/marker_black.png',
7373
});
7474
// mBuilder.bitmap = BitmapUtils.createBitmapFromAndroidBitmap(cBuilder.image)
7575
// mBuilder.size = 30.0;
@@ -79,7 +79,7 @@ export default class Example extends BaseMaps {
7979
// Read GeoJSON, parse it using SDK GeoJSON parser
8080
// console.log('test projection', this.mapView.projection, (this.mapView.projection as Projection).getNative())
8181
const reader = new GeoJSONGeometryReader({
82-
targetProjection: this.mapView.projection
82+
targetProjection: this.mapView.projection,
8383
});
8484
console.log('reader created');
8585
// reader.targetProjection = contentView?.projection
@@ -96,7 +96,7 @@ export default class Example extends BaseMaps {
9696
// This data set features point geometry, however, it can also be LineGeometry or PolygonGeometry
9797
const geometry = features.getGeometry(i);
9898
// console.log('feature geometry', geometry.getCenterPos().getX());
99-
elements.add(new Marker({ geometry, styleBuilder, metaData: { index: i+'' } }));
99+
elements.add(new Marker({ geometry, styleBuilder, metaData: { index: i + '' } }));
100100
}
101101
console.log('elements', elements.size());
102102
this.initializeClusterLayer();
@@ -120,14 +120,14 @@ export default class Example extends BaseMaps {
120120
let styleBuilder = this.findByKey(count);
121121
122122
if (count <= 1.0) {
123-
styleBuilder = (elements.getElement(0) as Marker).styleBuilder;
123+
styleBuilder = (elements.getElement(0) as Marker).styleBuilder as any;
124124
}
125125
126126
if (styleBuilder == null) {
127127
styleBuilder = new MarkerStyleBuilder({
128128
size: 30,
129129
placementPriority: -count,
130-
bitmap: '~/assets/images/marker_black.png'
130+
bitmap: '~/assets/images/marker_black.png',
131131
});
132132
// builder.bitmap = BitmapUtils.createBitmapFromAndroidBitmap(canvasBitmap)
133133
@@ -136,7 +136,7 @@ export default class Example extends BaseMaps {
136136
// console.log('buildClusterElement', pos, count, !!styleBuilder);
137137
return new Marker({ position, styleBuilder });
138138
},
139-
bitmap: '~/assets/images/marker_black.png'
139+
bitmap: '~/assets/images/marker_black.png',
140140
});
141141
const dataSource = (this.dataSource = new LocalVectorDataSource({ projection: this.mapView.projection }));
142142
const layer = new ClusteredVectorLayer({ dataSource, builder, minimumClusterDistance: 50 });
@@ -154,22 +154,22 @@ export default class Example extends BaseMaps {
154154
switch (id) {
155155
case 'voyager':
156156
this.currentLayer = new CartoOnlineVectorTileLayer({
157-
style: CartoMapStyle.VOYAGER
157+
style: CartoMapStyle.VOYAGER,
158158
});
159159
break;
160160
case 'positron':
161161
this.currentLayer = new CartoOnlineVectorTileLayer({
162-
style: CartoMapStyle.POSITRON
162+
style: CartoMapStyle.POSITRON,
163163
});
164164
break;
165165
case 'darkmatter':
166166
this.currentLayer = new CartoOnlineVectorTileLayer({
167-
style: CartoMapStyle.DARKMATTER
167+
style: CartoMapStyle.DARKMATTER,
168168
});
169169
break;
170170
default: {
171171
this.currentLayer = new CartoOnlineRasterTileLayer({
172-
source: id + '@2x'
172+
source: id + '@2x',
173173
});
174174
}
175175
}
@@ -200,17 +200,17 @@ export default class Example extends BaseMaps {
200200
action({
201201
title: 'Layer',
202202
message: 'Select Layer',
203-
actions: this.layerTypes
204-
}).then(result => {
203+
actions: this.layerTypes,
204+
}).then((result) => {
205205
result && this.setCurrentLayer(result);
206206
});
207207
}
208208
onSelectLanguage() {
209209
action({
210210
title: 'Language',
211211
message: 'Select Language',
212-
actions: this.languages
213-
}).then(result => {
212+
actions: this.languages,
213+
}).then((result) => {
214214
result && this.updateLanguage(result);
215215
});
216216
}

0 commit comments

Comments
 (0)