@mptw/skylens-ui 1.4.100 → 1.4.101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,24 +41,17 @@ export default defineComponent({
41
41
 
42
42
  if (!map) {
43
43
  map = new $Map(mapEl.value, {
44
+ zoom: 11,
45
+ mapId: '160f8be79f87792deee048cf',
44
46
  center: { lat: 37.77325660358167, lng: -122.41712341793448 },
45
47
  disableDefaultUI: true,
46
- styles: [
47
- {
48
- featureType: "poi",
49
- stylers: [{ visibility: "off" }],
50
- },
51
- {
52
- featureType: "transit",
53
- stylers: [{ visibility: "off" }],
54
- },
55
- ],
56
48
  });
57
49
  }
58
50
 
59
51
  overlay = new GoogleMapsOverlay({});
60
52
  overlay.setMap(map);
61
53
 
54
+ setupMarkers();
62
55
  setupHeatmapData();
63
56
  }
64
57
 
@@ -100,7 +93,7 @@ export default defineComponent({
100
93
  weight: weight.weight,
101
94
  }));
102
95
 
103
- overlay.setOptions({
96
+ overlay.setProps({
104
97
  layers: [
105
98
  new HeatmapLayer({
106
99
  id: 'HeatmapLayer',
@@ -131,6 +124,10 @@ export default defineComponent({
131
124
  });
132
125
 
133
126
  onBeforeUnmount(() => {
127
+ if (overlay) {
128
+ overlay.finalize();
129
+ }
130
+ overlay = null;
134
131
  });
135
132
 
136
133
  return {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mptw/skylens-ui",
3
3
  "type": "module",
4
- "version": "1.4.100",
4
+ "version": "1.4.101",
5
5
  "main": "./nuxt.config.ts",
6
6
  "scripts": {
7
7
  "dev": "nuxi dev .playground",
package/pages/index.vue CHANGED
@@ -1,11 +1,37 @@
1
1
  <template lang="pug">
2
- .container
3
- SLHeatMap
2
+ .main
3
+ a(href='javascript:;', @click='onClickedToggle') toggle
4
+ .container
5
+ SLHeatMap(:latlons="latlons", :weights="latlons", :is-show-marker="isShowMarker")
4
6
  </template>
5
7
 
6
8
  <script lang="ts">
7
9
  export default defineComponent({
8
10
  name: 'IndexPage',
11
+ setup() {
12
+ const isShowMarker = ref(false);
13
+ const latlons = computed(() => {
14
+ return [
15
+ { weight: 4, lon: -122.42177834, lat: 37.78346622 },
16
+ { weight: 2, lon: -122.414411, lat: 37.774458 },
17
+ { weight: 2, lon: -122.438887, lat: 37.772737 },
18
+ { weight: 2, lon: -122.42019976, lat: 37.75087429 },
19
+ { weight: 2, lon: -122.392606, lat: 37.779369 },
20
+ { weight: 2, lon: -122.43065953, lat: 37.77185018 },
21
+ { weight: 2, lon: -122.43065953, lat: 37.77185018 },
22
+ { weight: 4, lon: -122.418974, lat: 37.754029 },
23
+ { weight: 14, lon: -122.419014, lat: 37.780519 },
24
+ { weight: 2, lon: -122.404719, lat: 37.770128 },
25
+ { weight: 2, lon: -122.390466, lat: 37.780226 },
26
+ ];
27
+ });
28
+
29
+ function onClickedToggle() {
30
+ isShowMarker.value = !isShowMarker.value;
31
+ }
32
+
33
+ return { latlons, isShowMarker, onClickedToggle };
34
+ },
9
35
  });
10
36
  </script>
11
37