-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
26 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,25 +6,23 @@ | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<meta property="og:description" content="Show all cluster's points in one HTML element" /> | ||
<title>MapLibre GL Teritorio Cluster</title> | ||
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl/dist/maplibre-gl.css"> | ||
<script src="https://unpkg.com/[email protected]/dist/maplibre-gl.js"></script> | ||
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/maplibre-gl.css"> | ||
</head> | ||
|
||
<body style="margin: 0; padding: 0;"> | ||
<div id="map" style="height: 100vh;"></div> | ||
|
||
<script src="https://unpkg.com/maplibre-gl/dist/maplibre-gl.js"></script> | ||
<script type="module"> | ||
import { Map, NavigationControl, Marker } from "maplibre-gl" | ||
import { TeritorioCluster } from './src' | ||
import { buildCss, unfoldedClusterRenderCircle as unfoldedClusterRender } from './src/utils/helpers' | ||
import { TeritorioCluster } from '../src' | ||
import { buildCss, unfoldedClusterRenderCircle as unfoldedClusterRender } from '../src/utils/helpers' | ||
|
||
const map = new Map({ | ||
const map = new maplibregl.Map({ | ||
hash: true, | ||
container: "map", | ||
style: 'https://api.maptiler.com/maps/openstreetmap/style.json?key=GIAfARJO9HDgKceZRlGv' | ||
}); | ||
|
||
map.addControl(new NavigationControl()); | ||
map.addControl(new maplibregl.NavigationControl()); | ||
|
||
map.on('load', async () => { | ||
let geojson = await fetch('https://maplibre.org/maplibre-gl-js/docs/assets/earthquakes.geojson', { method: 'GET' }).then(res => res.json()) | ||
|
@@ -89,7 +87,7 @@ | |
}) | ||
|
||
const pinMarkerRender = (coords, offset) => { | ||
return new Marker({ | ||
return new maplibregl.Marker({ | ||
scale: 1.3, | ||
color: '#f44336', | ||
anchor: 'bottom' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,19 +14,19 @@ | |
"node": ">=10" | ||
}, | ||
"scripts": { | ||
"dev": "vite", | ||
"dev": "vite serve docs", | ||
"start": "tsdx watch", | ||
"build": "tsdx build", | ||
"prepare": "tsdx build" | ||
}, | ||
"module": "dist/maplibre-gl-teritorio-cluster.esm.js", | ||
"module": "./dist/maplibre-gl-teritorio-cluster.esm.js", | ||
"devDependencies": { | ||
"tsdx": "^0.14.1", | ||
"tslib": "^2.6.3", | ||
"typescript": "^5.5.4", | ||
"vite": "^5.4.0" | ||
}, | ||
"packageManager": "[email protected].0", | ||
"packageManager": "[email protected].1", | ||
"dependencies": { | ||
"maplibre-gl": "^4.0.0" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
import { TeritorioCluster } from "./teritorioCluster"; | ||
|
||
export { TeritorioCluster } | ||
export { TeritorioCluster } from "./teritorio-cluster"; | ||
export { buildCss, unfoldedClusterRenderCircle } from "./utils/helpers"; |
File renamed without changes.