-
-
Notifications
You must be signed in to change notification settings - Fork 739
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollback to mapbox gl draw example (#5138)
* Rollback to mapbox-gl-draw * update style import
- Loading branch information
Showing
2 changed files
with
8 additions
and
8 deletions.
There are no files selected for viewing
File renamed without changes
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 |
---|---|---|
|
@@ -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"> | ||
|
@@ -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 | ||
|
@@ -59,7 +59,7 @@ | |
zoom: 12 // starting zoom | ||
}); | ||
|
||
const draw = new MapLibreDraw({ | ||
const draw = new MapboxDraw({ | ||
displayControlsDefault: false, | ||
controls: { | ||
polygon: true, | ||
|