Skip to content

Commit

Permalink
Rollback to mapbox gl draw example (#5138)
Browse files Browse the repository at this point in the history
* Rollback to mapbox-gl-draw

* update style import
  • Loading branch information
birkskyum authored Dec 1, 2024
1 parent 5f800b6 commit 9a85e82
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@
font-size: 13px;
}
</style>
<link
rel="stylesheet"
href="https://esm.sh/jsr/@birkskyum/maplibre-gl-draw@^2/dist/maplibre-gl-draw.css"
<script src="https://www.unpkg.com/@mapbox/[email protected]/dist/mapbox-gl-draw.js"></script>
<link
rel="stylesheet"
href="https://www.unpkg.com/@mapbox/[email protected]/dist/mapbox-gl-draw.css"
/>
<div id="map"></div>
<div class="calculation-box">
Expand All @@ -46,10 +47,9 @@

import * as turf from 'https://esm.sh/@turf/[email protected]';

import {MapLibreDraw} from 'https://esm.sh/jsr/@birkskyum/maplibre-gl-draw@^2';
MapLibreDraw.constants.classes.CONTROL_BASE = 'maplibregl-ctrl';
MapLibreDraw.constants.classes.CONTROL_PREFIX = 'maplibregl-ctrl-';
MapLibreDraw.constants.classes.CONTROL_GROUP = 'maplibregl-ctrl-group';
MapboxDraw.constants.classes.CONTROL_BASE = 'maplibregl-ctrl';
MapboxDraw.constants.classes.CONTROL_PREFIX = 'maplibregl-ctrl-';
MapboxDraw.constants.classes.CONTROL_GROUP = 'maplibregl-ctrl-group';

const map = new maplibregl.Map({
container: 'map', // container id
Expand All @@ -59,7 +59,7 @@
zoom: 12 // starting zoom
});

const draw = new MapLibreDraw({
const draw = new MapboxDraw({
displayControlsDefault: false,
controls: {
polygon: true,
Expand Down

0 comments on commit 9a85e82

Please sign in to comment.