@mptw/skylens-ui 1.4.99 → 1.4.100
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.
- package/components/SLHeatMap.vue +7 -7
- package/nuxt.config.ts +1 -1
- package/package.json +1 -1
- package/pages/index.vue +15 -0
- package/plugins/googlemap.ts +6 -4
package/components/SLHeatMap.vue
CHANGED
|
@@ -27,7 +27,7 @@ export default defineComponent({
|
|
|
27
27
|
},
|
|
28
28
|
},
|
|
29
29
|
setup(props) {
|
|
30
|
-
const { LatLngBounds, LatLng, AdvancedMarkerElement, Map } = useNuxtApp();
|
|
30
|
+
const { $LatLngBounds, $LatLng, $AdvancedMarkerElement, $Map } = useNuxtApp();
|
|
31
31
|
const { latlons, weights, isShowMarker } = toRefs(props);
|
|
32
32
|
|
|
33
33
|
const mapEl = shallowRef<HTMLElement | null>(null);
|
|
@@ -40,7 +40,8 @@ export default defineComponent({
|
|
|
40
40
|
if (!mapEl.value) return;
|
|
41
41
|
|
|
42
42
|
if (!map) {
|
|
43
|
-
map = Map(mapEl.value, {
|
|
43
|
+
map = new $Map(mapEl.value, {
|
|
44
|
+
center: { lat: 37.77325660358167, lng: -122.41712341793448 },
|
|
44
45
|
disableDefaultUI: true,
|
|
45
46
|
styles: [
|
|
46
47
|
{
|
|
@@ -55,7 +56,6 @@ export default defineComponent({
|
|
|
55
56
|
});
|
|
56
57
|
}
|
|
57
58
|
|
|
58
|
-
map.setCenter({ lat: 23.586114913594802, lng: 120.87814086119803 });
|
|
59
59
|
overlay = new GoogleMapsOverlay({});
|
|
60
60
|
overlay.setMap(map);
|
|
61
61
|
|
|
@@ -63,19 +63,19 @@ export default defineComponent({
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
function setupMarkers() {
|
|
66
|
-
const bounds = new LatLngBounds();
|
|
66
|
+
const bounds = new $LatLngBounds();
|
|
67
67
|
markers.forEach((marker) => marker.setMap(null));
|
|
68
68
|
markers = [];
|
|
69
69
|
|
|
70
70
|
latlons.value.forEach((latlon) => {
|
|
71
|
-
const position = new LatLng(
|
|
71
|
+
const position = new $LatLng(
|
|
72
72
|
Number(latlon.lat),
|
|
73
73
|
Number(latlon.lon)
|
|
74
74
|
);
|
|
75
75
|
bounds.extend(position);
|
|
76
76
|
|
|
77
77
|
markers.push(
|
|
78
|
-
new AdvancedMarkerElement({
|
|
78
|
+
new $AdvancedMarkerElement({
|
|
79
79
|
position,
|
|
80
80
|
map: isShowMarker.value ? map : null,
|
|
81
81
|
})
|
|
@@ -140,7 +140,7 @@ export default defineComponent({
|
|
|
140
140
|
});
|
|
141
141
|
</script>
|
|
142
142
|
|
|
143
|
-
<style lang="stylus">
|
|
143
|
+
<style lang="stylus" scoped>
|
|
144
144
|
.heat-map
|
|
145
145
|
@apply w-full h-full
|
|
146
146
|
</style>
|
package/nuxt.config.ts
CHANGED
|
@@ -11,7 +11,7 @@ export default defineNuxtConfig({
|
|
|
11
11
|
public: {
|
|
12
12
|
defaultMobileEndDateBeforeNow: 4,
|
|
13
13
|
icoUrl: 'https://skylens-mng-dev-1087511617183.asia-east1.run.app',
|
|
14
|
-
googleMapsApiKey: '
|
|
14
|
+
googleMapsApiKey: 'AIzaSyDMNNizDMizdxJd3oAhsbkx1kL5Gyicnns',
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
components: [
|
package/package.json
CHANGED
package/pages/index.vue
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template lang="pug">
|
|
2
|
+
.container
|
|
3
|
+
SLHeatMap
|
|
4
|
+
</template>
|
|
5
|
+
|
|
6
|
+
<script lang="ts">
|
|
7
|
+
export default defineComponent({
|
|
8
|
+
name: 'IndexPage',
|
|
9
|
+
});
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<style lang="stylus" scoped>
|
|
13
|
+
.container
|
|
14
|
+
@apply s('w-[600px]') s('h-[480px]')
|
|
15
|
+
</style>
|
package/plugins/googlemap.ts
CHANGED
|
@@ -2,15 +2,17 @@ import { setOptions, importLibrary } from '@googlemaps/js-api-loader';
|
|
|
2
2
|
|
|
3
3
|
declare module '#app' {
|
|
4
4
|
interface NuxtApp {
|
|
5
|
-
LatLngBounds: google.maps.LatLngBounds;
|
|
6
|
-
LatLng: google.maps.LatLng;
|
|
7
|
-
Map: google.maps.Map;
|
|
8
|
-
AdvancedMarkerElement: google.maps.AdvancedMarkerElement;
|
|
5
|
+
$LatLngBounds: google.maps.LatLngBounds;
|
|
6
|
+
$LatLng: google.maps.LatLng;
|
|
7
|
+
$Map: google.maps.Map;
|
|
8
|
+
$AdvancedMarkerElement: google.maps.AdvancedMarkerElement;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
export default defineNuxtPlugin(async (nuxtApp) => {
|
|
14
|
+
if (!import.meta.client) return;
|
|
15
|
+
|
|
14
16
|
const runtimeConfig = useRuntimeConfig();
|
|
15
17
|
setOptions({
|
|
16
18
|
key: runtimeConfig.public.googleMapsApiKey,
|