-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBasicRaster.vue
More file actions
56 lines (50 loc) · 1.76 KB
/
Copy pathBasicRaster.vue
File metadata and controls
56 lines (50 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<template>
<Page ref="page">
<ActionBar :title="title" backgroundColor="#3F51B5">
<NavigationButton text="Go Back" android.systemIcon="ic_menu_back" @tap="$navigateBack" />
</ActionBar>
<GridLayout orientation="vertical" rows="*,50">
<!-- <BottomSheet :steps="[0, 100]"> -->
<MassifMap ref="mapView" row="0" zoom="15" width="100%" height="100%" @mapReady="onMapReady" focusPos="45.19199, 5.7190" />
<!-- <GridLayout ref="bottomSheet" :height="100" /> -->
<!-- </BottomSheet> -->
</GridLayout>
</Page>
</template>
<script lang="ts">
import { HTTPTileDataSource } from '@nativescript-community/ui-massifmaps/datasources/http';
import { RasterTileLayer } from '@nativescript-community/ui-massifmaps/layers/raster';
import { MassifMap, MapEventData } from '@nativescript-community/ui-massifmaps/ui';
import Vue from 'nativescript-vue';
import { Component } from 'vue-property-decorator';
@Component({})
export default class BasicRaster extends Vue {
title: string;
destroyed() {
// setTimeout(function () {
// __collect();
// }, 2000);
}
onMapReady(e: MapEventData) {
const mapView = e.object as MassifMap;
mapView.setFocusPos({ longitude: 6, latitude: 45 }, 0);
const dataSource = new HTTPTileDataSource({
minZoom: 0,
maxZoom: 22,
subdomains: 'abc',
url: 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'
});
const rasterLayer = new RasterTileLayer({
dataSource,
zoomLevelBias: 1
});
mapView.addLayer(rasterLayer);
}
}
</script>
<style scoped>
ActionBar {
background-color: #3f51b5;
color: #ffffff;
}
</style>