@maptiler/sdk 1.0.10 → 1.0.11
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/CHANGELOG.md +4 -0
- package/demos/maptiler-sdk.umd.js +1 -0
- package/dist/maptiler-sdk.d.ts +24 -2
- package/dist/maptiler-sdk.min.mjs +1 -1
- package/dist/maptiler-sdk.mjs +1 -1
- package/dist/maptiler-sdk.mjs.map +1 -1
- package/dist/maptiler-sdk.umd.js +1 -0
- package/dist/maptiler-sdk.umd.js.map +1 -1
- package/dist/maptiler-sdk.umd.min.js +4 -4
- package/package.json +1 -1
- package/src/Map.ts +8 -1
- package/src/index.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
+
## [v1.0.11](https://github.com/maptiler/maptiler-sdk-js/releases/tag/v1.0.11)
|
|
3
|
+
- DOC update for `Map`'s `option.maptilerLogo` that was a bit unclear
|
|
4
|
+
- FIX now exporting `MaptilerNavigationControl`
|
|
5
|
+
|
|
2
6
|
## [v1.0.10](https://github.com/maptiler/maptiler-sdk-js/releases/tag/v1.0.10)
|
|
3
7
|
- ADD terrain growing animation on enabling/disabling
|
|
4
8
|
- ADD `Map` custom event `loadWithTerrain`
|
|
@@ -3877,6 +3877,7 @@
|
|
|
3877
3877
|
exports.MapStyleVariant = MapStyleVariant;
|
|
3878
3878
|
exports.MaptilerGeolocateControl = MaptilerGeolocateControl;
|
|
3879
3879
|
exports.MaptilerLogoControl = MaptilerLogoControl;
|
|
3880
|
+
exports.MaptilerNavigationControl = MaptilerNavigationControl;
|
|
3880
3881
|
exports.MaptilerTerrainControl = MaptilerTerrainControl;
|
|
3881
3882
|
exports.Marker = Marker;
|
|
3882
3883
|
exports.MarkerMLGL = MarkerMLGL;
|
package/dist/maptiler-sdk.d.ts
CHANGED
|
@@ -206,7 +206,14 @@ type MapOptions = Omit<MapOptions$1, "style" | "maplibreLogo"> & {
|
|
|
206
206
|
*/
|
|
207
207
|
apiKey?: string;
|
|
208
208
|
/**
|
|
209
|
-
* Shows the MapTiler logo
|
|
209
|
+
* Shows or hides the MapTiler logo in the bottom left corner.
|
|
210
|
+
*
|
|
211
|
+
* For paid plans:
|
|
212
|
+
* - `true` shows MapTiler logo
|
|
213
|
+
* - `false` hodes MapTiler logo
|
|
214
|
+
* - default: `false` (hide)
|
|
215
|
+
*
|
|
216
|
+
* For free plans: MapTiler logo always shows, regardless of the value.
|
|
210
217
|
*/
|
|
211
218
|
maptilerLogo?: boolean;
|
|
212
219
|
/**
|
|
@@ -563,6 +570,21 @@ declare class MaptilerTerrainControl implements maplibregl.IControl {
|
|
|
563
570
|
_updateTerrainIcon(): void;
|
|
564
571
|
}
|
|
565
572
|
|
|
573
|
+
type HTMLButtonElementPlus = HTMLButtonElement & {
|
|
574
|
+
clickFunction: (e?: any) => unknown;
|
|
575
|
+
};
|
|
576
|
+
declare class MaptilerNavigationControl extends NavigationControl {
|
|
577
|
+
constructor();
|
|
578
|
+
/**
|
|
579
|
+
* Overloading: the button now stores its click callback so that we can later on delete it and replace it
|
|
580
|
+
*/
|
|
581
|
+
_createButton(className: string, fn: (e?: any) => unknown): HTMLButtonElementPlus;
|
|
582
|
+
/**
|
|
583
|
+
* Overloading: Limit how flat the compass icon can get
|
|
584
|
+
*/
|
|
585
|
+
_rotateCompassArrow(): void;
|
|
586
|
+
}
|
|
587
|
+
|
|
566
588
|
/**
|
|
567
589
|
* This is TypeScript rewrite of the Point class to use instead of the version imported in MapLibre.
|
|
568
590
|
* It also uses a class instead of prototypes.
|
|
@@ -802,4 +824,4 @@ type VideoSourceMLGL = InstanceType<typeof VideoSourceMLGL>;
|
|
|
802
824
|
declare const MapMLGL: typeof maplibre_gl.Map;
|
|
803
825
|
type MapMLGL = InstanceType<typeof MapMLGL>;
|
|
804
826
|
|
|
805
|
-
export { AJAXError, AttributionControl, AttributionControlMLGL, CanvasSource, CanvasSourceMLGL, Evented, FullscreenControl, FullscreenControlMLGL, GeoJSONSource, GeoJSONSourceMLGL, GeolocateControl, GeolocateControlMLGL, GeolocationType, ImageSource, ImageSourceMLGL, Language, LanguageKey, LanguageString, LngLat, LngLatBounds, LoadWithTerrainEvent, LogoControl, LogoControlMLGL, Map, MapMLGL, MapOptions, MaptilerGeolocateControl, MaptilerLogoControl, MaptilerTerrainControl, Marker, MarkerMLGL, Matrix2, MercatorCoordinate, NavigationControl, NavigationControlMLGL, Point, Popup, PopupMLGL, RasterDEMTileSource, RasterDEMTileSourceMLGL, RasterTileSource, RasterTileSourceMLGL, ScaleControl, ScaleControlMLGL, SdkConfig, Style, StyleMLGL, TerrainControl, TerrainControlMLGL, Unit, VectorTileSource, VectorTileSourceMLGL, VideoSource, VideoSourceMLGL, addProtocol, clearPrewarmedResources, config, getRTLTextPluginStatus, maxParallelImageRequests, prewarm, removeProtocol, setRTLTextPlugin, supported, version, workerCount, workerUrl };
|
|
827
|
+
export { AJAXError, AttributionControl, AttributionControlMLGL, CanvasSource, CanvasSourceMLGL, Evented, FullscreenControl, FullscreenControlMLGL, GeoJSONSource, GeoJSONSourceMLGL, GeolocateControl, GeolocateControlMLGL, GeolocationType, ImageSource, ImageSourceMLGL, Language, LanguageKey, LanguageString, LngLat, LngLatBounds, LoadWithTerrainEvent, LogoControl, LogoControlMLGL, Map, MapMLGL, MapOptions, MaptilerGeolocateControl, MaptilerLogoControl, MaptilerNavigationControl, MaptilerTerrainControl, Marker, MarkerMLGL, Matrix2, MercatorCoordinate, NavigationControl, NavigationControlMLGL, Point, Popup, PopupMLGL, RasterDEMTileSource, RasterDEMTileSourceMLGL, RasterTileSource, RasterTileSourceMLGL, ScaleControl, ScaleControlMLGL, SdkConfig, Style, StyleMLGL, TerrainControl, TerrainControlMLGL, Unit, VectorTileSource, VectorTileSourceMLGL, VideoSource, VideoSourceMLGL, addProtocol, clearPrewarmedResources, config, getRTLTextPluginStatus, maxParallelImageRequests, prewarm, removeProtocol, setRTLTextPlugin, supported, version, workerCount, workerUrl };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import a from"maplibre-gl";export*from"maplibre-gl";import{Base64 as q}from"js-base64";import{v4 as W}from"uuid";import J from"events";import{config as T,expandMapStyle as Z,MapStyleVariant as Y,ReferenceMapStyle as X,MapStyle as Q,mapStylePresetList as tt,geolocation as w}from"@maptiler/client";import{LanguageGeocoding as me,MapStyle as ye,MapStyleVariant as Ae,ReferenceMapStyle as fe,ServiceError as Le,coordinates as _e,data as Se,geocoding as xe,geolocation as Ce,staticMaps as Te}from"@maptiler/client";const L={AUTO:"auto",LATIN:"latin",NON_LATIN:"nonlatin",LOCAL:"",ALBANIAN:"sq",AMHARIC:"am",ARABIC:"ar",ARMENIAN:"hy",AZERBAIJANI:"az",BASQUE:"eu",BELORUSSIAN:"be",BOSNIAN:"bs",BRETON:"br",BULGARIAN:"bg",CATALAN:"ca",CHINESE:"zh",CORSICAN:"co",CROATIAN:"hr",CZECH:"cs",DANISH:"da",DUTCH:"nl",ENGLISH:"en",ESPERANTO:"eo",ESTONIAN:"et",FINNISH:"fi",FRENCH:"fr",FRISIAN:"fy",GEORGIAN:"ka",GERMAN:"de",GREEK:"el",HEBREW:"he",HINDI:"hi",HUNGARIAN:"hu",ICELANDIC:"is",INDONESIAN:"id",IRISH:"ga",ITALIAN:"it",JAPANESE:"ja",JAPANESE_HIRAGANA:"ja-Hira",JAPANESE_KANA:"ja_kana",JAPANESE_LATIN:"ja_rm",JAPANESE_2018:"ja-Latn",KANNADA:"kn",KAZAKH:"kk",KOREAN:"ko",KOREAN_LATIN:"ko-Latn",KURDISH:"ku",ROMAN_LATIN:"la",LATVIAN:"lv",LITHUANIAN:"lt",LUXEMBOURGISH:"lb",MACEDONIAN:"mk",MALAYALAM:"ml",MALTESE:"mt",NORWEGIAN:"no",OCCITAN:"oc",POLISH:"pl",PORTUGUESE:"pt",ROMANIAN:"ro",ROMANSH:"rm",RUSSIAN:"ru",SCOTTISH_GAELIC:"gd",SERBIAN_CYRILLIC:"sr",SERBIAN_LATIN:"sr-Latn",SLOVAK:"sk",SLOVENE:"sl",SPANISH:"es",SWEDISH:"sv",TAMIL:"ta",TELUGU:"te",THAI:"th",TURKISH:"tr",UKRAINIAN:"uk",WELSH:"cy"},et=new Set(Object.values(L));function v(r){return et.has(r)}const rt=new Set(Object.values(L));function b(){if(typeof navigator>"u")return Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0];const r=Array.from(new Set(navigator.languages.map(t=>t.split("-")[0]))).filter(t=>rt.has(t));return r.length?r[0]:L.LATIN}let E=class extends J{constructor(){super(),this.primaryLanguage=L.AUTO,this.secondaryLanguage=null,this.session=!0,this._unit="metric",this._apiKey=""}set unit(t){this._unit=t,this.emit("unit",t)}get unit(){return this._unit}set apiKey(t){this._apiKey=t,T.apiKey=t,this.emit("apiKey",t)}get apiKey(){return this._apiKey}set fetch(t){T.fetch=t}get fetch(){return T.fetch}};const A=new E,y={maptilerLogoURL:"https://api.maptiler.com/resources/logo.svg",maptilerURL:"https://www.maptiler.com/",maptilerApiHost:"api.maptiler.com",rtlPluginURL:"https://cdn.maptiler.com/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.min.js",primaryLanguage:L.AUTO,secondaryLanguage:L.LOCAL,terrainSourceURL:"https://api.maptiler.com/tiles/terrain-rgb-v2/tiles.json",terrainSourceId:"maptiler-terrain"};Object.freeze(y);class N extends a.LogoControl{onAdd(t){return super.onAdd(t)}}class I extends N{constructor(t={}){var e,n;super(t),this.logoURL="",this.linkURL="",this.logoURL=(e=t.logoURL)!=null?e:y.maptilerLogoURL,this.linkURL=(n=t.linkURL)!=null?n:y.maptilerURL}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=window.document.createElement("div"),this._container.className="maplibregl-ctrl";const e=window.document.createElement("a");return e.style.backgroundRepeat="no-repeat",e.style.cursor="pointer",e.style.display="block",e.style.height="23px",e.style.margin="0 0 -4px -4px",e.style.overflow="hidden",e.style.width="88px",e.style.backgroundImage=`url(${this.logoURL})`,e.style.backgroundSize="100px 30px",e.style.width="100px",e.style.height="30px",e.target="_blank",e.rel="noopener nofollow",e.href=this.linkURL,e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}}function it(){a.getRTLTextPluginStatus()==="unavailable"&&a.setRTLTextPlugin(y.rtlPluginURL,null,!0)}function nt(r,t){r.forEach(e=>{t[e]&&(t[e]=t[e].bind(t))})}function S(r,t,e){const n=window.document.createElement(r);return t!==void 0&&(n.className=t),e&&e.appendChild(n),n}function at(r){r.parentNode&&r.parentNode.removeChild(r)}function R(r){return r?typeof r=="string"||r instanceof String?!r.startsWith("http")&&r.toLowerCase().includes(".json")?r:Z(r):r instanceof Y?r.getExpandedStyleURL():r instanceof X?r.getDefaultVariant().getExpandedStyleURL():r:Q[tt[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL()}class P{constructor(){nt(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(t){return this._map=t,this._container=S("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=S("button","maplibregl-ctrl-terrain",this._container),S("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){at(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}_toggleTerrain(){this._map.hasTerrain()?this._map.disableTerrain():this._map.enableTerrain(),this._updateTerrainIcon()}_updateTerrainIcon(){this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.hasTerrain()?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))}}class M extends a.NavigationControl{onAdd(t){return super.onAdd(t)}}class ot extends M{constructor(){super({showCompass:!0,showZoom:!0,visualizePitch:!0}),this._compass.removeEventListener("click",this._compass.clickFunction),this._compass.addEventListener("click",t=>{this._map.getPitch()===0?this._map.easeTo({pitch:Math.min(this._map.getMaxPitch(),80)}):this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})})}_createButton(t,e){const n=super._createButton(t,e);return n.clickFunction=e,n}_rotateCompassArrow(){const t=this.options.visualizePitch?`scale(${Math.min(1.5,1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5))}) rotateX(${Math.min(70,this._map.transform.pitch)}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=t}}class O extends a.GeolocateControl{onAdd(t){return super.onAdd(t)}}var st=Object.defineProperty,lt=Object.defineProperties,ct=Object.getOwnPropertyDescriptors,U=Object.getOwnPropertySymbols,ht=Object.prototype.hasOwnProperty,ut=Object.prototype.propertyIsEnumerable,k=(r,t,e)=>t in r?st(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,dt=(r,t)=>{for(var e in t||(t={}))ht.call(t,e)&&k(r,e,t[e]);if(U)for(var e of U(t))ut.call(t,e)&&k(r,e,t[e]);return r},gt=(r,t)=>lt(r,ct(t));const B=a.Marker,$=a.LngLat;class G extends O{constructor(){super(...arguments),this.lastUpdatedCenter=new $(0,0)}_updateCamera(t){const e=new $(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,s=this._map.getBearing(),d=gt(dt({bearing:s},this.options.fitBoundsOptions),{linear:!0}),u=this._map.getZoom();u>this.options.fitBoundsOptions.maxZoom&&(d.zoom=u),this._map.fitBounds(e.toBounds(n),d,{geolocateSource:!0});let h=!1;const o=()=>{h=!0};this._map.once("click",o),this._map.once("dblclick",o),this._map.once("dragstart",o),this._map.once("mousedown",o),this._map.once("touchstart",o),this._map.once("wheel",o),this._map.once("moveend",()=>{this._map.off("click",o),this._map.off("dblclick",o),this._map.off("dragstart",o),this._map.off("mousedown",o),this._map.off("touchstart",o),this._map.off("wheel",o),!h&&(this.lastUpdatedCenter=this._map.getCenter())})}_setupUI(t){if(this.lastUpdatedCenter=this._map.getCenter(),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this._geolocateButton=S("button","maplibregl-ctrl-geolocate",this._container),S("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",t===!1){const e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}else{const e=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=S("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new B(this._dotElement),this._circleElement=S("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new B({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("move",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("moveend",e=>{const n=e.originalEvent&&e.originalEvent.type==="resize",s=this.lastUpdatedCenter.distanceTo(this._map.getCenter());!e.geolocateSource&&this._watchState==="ACTIVE_LOCK"&&!n&&s>1&&(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new Event("trackuserlocationend")))})}_updateCircleRadius(){if(this._watchState!=="BACKGROUND"&&this._watchState!=="ACTIVE_LOCK")return;const t=[this._lastKnownPosition.coords.longitude,this._lastKnownPosition.coords.latitude],e=this._map.project(t),n=this._map.unproject([e.x,e.y]),s=this._map.unproject([e.x+20,e.y]),d=n.distanceTo(s)/20,u=Math.ceil(2*this._accuracy/d);this._circleElement.style.width=`${u}px`,this._circleElement.style.height=`${u}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}}class H extends a.AttributionControl{onAdd(t){return super.onAdd(t)}}class j extends a.ScaleControl{onAdd(t){return super.onAdd(t)}}class K extends a.FullscreenControl{onAdd(t){return super.onAdd(t)}}var pt=Object.defineProperty,mt=Object.defineProperties,yt=Object.getOwnPropertyDescriptors,F=Object.getOwnPropertySymbols,At=Object.prototype.hasOwnProperty,ft=Object.prototype.propertyIsEnumerable,D=(r,t,e)=>t in r?pt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Lt=(r,t)=>{for(var e in t||(t={}))At.call(t,e)&&D(r,e,t[e]);if(F)for(var e of F(t))ft.call(t,e)&&D(r,e,t[e]);return r},_t=(r,t)=>mt(r,yt(t)),_=(r,t,e)=>new Promise((n,s)=>{var d=o=>{try{h(e.next(o))}catch(m){s(m)}},u=o=>{try{h(e.throw(o))}catch(m){s(m)}},h=o=>o.done?n(o.value):Promise.resolve(o.value).then(d,u);h((e=e.apply(r,t)).next())});const V=W(),z={POINT:"POINT",COUNTRY:"COUNTRY"};class St extends a.Map{constructor(t){var e,n,s;t.apiKey&&(A.apiKey=t.apiKey);const d=R(t.style),u=location.hash;A.apiKey||console.warn("MapTiler Cloud API key is not set. Visit https://maptiler.com and try Cloud for free!"),super(_t(Lt({},t),{style:d,maplibreLogo:!1,transformRequest:c=>{let i=null;try{i=new URL(c)}catch{return{url:c,headers:{}}}return i.host===y.maptilerApiHost&&(i.searchParams.has("key")||i.searchParams.append("key",A.apiKey),A.session&&i.searchParams.append("mtsid",V)),{url:i.href,headers:{}}}})),this.isTerrainEnabled=!1,this.terrainExaggeration=1,this.primaryLanguage=null,this.secondaryLanguage=null,this.terrainGrowing=!1,this.terrainFlattening=!1,this.primaryLanguage=(e=t.language)!=null?e:A.primaryLanguage,this.secondaryLanguage=A.secondaryLanguage,this.terrainExaggeration=(n=t.terrainExaggeration)!=null?n:this.terrainExaggeration,this.once("styledata",()=>_(this,null,function*(){if(!t.geolocate||t.center||t.hash&&u)return;try{if(t.geolocate===z.COUNTRY){yield this.fitToIpBounds();return}}catch(i){console.warn(i.message)}let c=null;try{yield this.centerOnIpPoint(t.zoom),c=this.getCameraHash()}catch(i){console.warn(i.message)}(yield navigator.permissions.query({name:"geolocation"})).state==="granted"&&navigator.geolocation.getCurrentPosition(i=>{c===this.getCameraHash()&&(this.terrain?this.easeTo({center:[i.coords.longitude,i.coords.latitude],zoom:t.zoom||12,duration:2e3}):this.once("terrain",()=>{this.easeTo({center:[i.coords.longitude,i.coords.latitude],zoom:t.zoom||12,duration:2e3})}))},null,{maximumAge:24*3600*1e3,timeout:5e3,enableHighAccuracy:!1})})),this.on("styledata",()=>{this.setPrimaryLanguage(this.primaryLanguage),this.setSecondaryLanguage(this.secondaryLanguage)}),this.on("styledata",()=>{this.getTerrain()===null&&this.isTerrainEnabled&&this.enableTerrain(this.terrainExaggeration)}),this.once("load",()=>_(this,null,function*(){it()})),this.once("load",()=>_(this,null,function*(){let c={logo:null};try{const i=Object.keys(this.style.sourceCaches).map(l=>this.getSource(l)).filter(l=>typeof l.url=="string"&&l.url.includes("tiles.json")),p=new URL(i[0].url);p.searchParams.has("key")||p.searchParams.append("key",A.apiKey),c=yield(yield fetch(p.href)).json()}catch{}if("logo"in c&&c.logo){const i=c.logo;this.addControl(new I({logoURL:i}),t.logoPosition),t.attributionControl===!1&&this.addControl(new H(t))}else t.maptilerLogo&&this.addControl(new I,t.logoPosition);if(t.scaleControl){const i=t.scaleControl===!0||t.scaleControl===void 0?"bottom-right":t.scaleControl,p=new j({unit:A.unit});this.addControl(p,i),A.on("unit",l=>{p.setUnit(l)})}if(t.navigationControl!==!1){const i=t.navigationControl===!0||t.navigationControl===void 0?"top-right":t.navigationControl;this.addControl(new ot,i)}if(t.geolocateControl!==!1){const i=t.geolocateControl===!0||t.geolocateControl===void 0?"top-right":t.geolocateControl;this.addControl(new G({positionOptions:{enableHighAccuracy:!0,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!0,showAccuracyCircle:!0,showUserLocation:!0}),i)}if(t.terrainControl){const i=t.terrainControl===!0||t.terrainControl===void 0?"top-right":t.terrainControl;this.addControl(new P,i)}if(t.fullscreenControl){const i=t.fullscreenControl===!0||t.fullscreenControl===void 0?"top-right":t.fullscreenControl;this.addControl(new K({}),i)}}));let h=!1,o=!1,m=null;this.once("load",c=>{h=!0,o&&this.fire("loadWithTerrain",m)});const g=c=>{c.terrain&&(o=!0,m={type:"loadWithTerrain",target:this,terrain:c.terrain},this.off("terrain",g),h&&this.fire("loadWithTerrain",m))};this.on("terrain",g),t.terrain&&this.enableTerrain((s=t.terrainExaggeration)!=null?s:this.terrainExaggeration)}onLoadAsync(){return _(this,null,function*(){return new Promise((t,e)=>{if(this.loaded())return t(this);this.once("load",n=>{t(this)})})})}onLoadWithTerrainAsync(){return _(this,null,function*(){return new Promise((t,e)=>{if(this.loaded()&&this.terrain)return t(this);this.once("loadWithTerrain",n=>{t(this)})})})}setStyle(t,e){return super.setStyle(R(t),e)}setLanguage(t=y.primaryLanguage){if(t===L.AUTO)return this.setLanguage(b());this.setPrimaryLanguage(t)}setPrimaryLanguage(t=y.primaryLanguage){v(t)&&(this.primaryLanguage=t,this.onStyleReady(()=>{if(t===L.AUTO)return this.setPrimaryLanguage(b());const e=this.getStyle().layers,n=/^\s*{\s*name\s*(:\s*(\S*))?\s*}$/,s=/^\s*name\s*(:\s*(\S*))?\s*$/,d=/^\s*{\s*name\s*(:\s*(\S*))?\s*}(\s*){\s*name\s*(:\s*(\S*))?\s*}$/,u=/^(.*)({\s*name\s*(:\s*(\S*))?\s*})(.*)$/,h=t?`name:${t}`:"name",o=["case",["has",h],["get",h],["get","name:latin"]];for(let m=0;m<e.length;m+=1){const g=e[m],c=g.layout;if(!c||!c["text-field"])continue;const i=this.getLayoutProperty(g.id,"text-field");let p;if(Array.isArray(i)&&i.length>=2&&i[0].trim().toLowerCase()==="concat"){const l=i.slice();for(let x=0;x<i.length;x+=1){const f=i[x];if((typeof f=="string"||f instanceof String)&&n.exec(f.toString())){l[x]=o;break}else if(Array.isArray(f)&&f.length>=2&&f[0].trim().toLowerCase()==="get"&&s.exec(f[1].toString())){l[x]=o;break}else if(Array.isArray(f)&&f.length===4&&f[0].trim().toLowerCase()==="case"){l[x]=o;break}}this.setLayoutProperty(g.id,"text-field",l)}else if(Array.isArray(i)&&i.length>=2&&i[0].trim().toLowerCase()==="get"&&s.exec(i[1].toString())){const l=o;this.setLayoutProperty(g.id,"text-field",l)}else if((typeof i=="string"||i instanceof String)&&n.exec(i.toString())){const l=o;this.setLayoutProperty(g.id,"text-field",l)}else if(Array.isArray(i)&&i.length===4&&i[0].trim().toLowerCase()==="case"){const l=o;this.setLayoutProperty(g.id,"text-field",l)}else if((typeof i=="string"||i instanceof String)&&(p=d.exec(i.toString()))!==null){const l=`{${h}}${p[3]}{name${p[4]||""}}`;this.setLayoutProperty(g.id,"text-field",l)}else if((typeof i=="string"||i instanceof String)&&(p=u.exec(i.toString()))!==null){const l=`${p[1]}{${h}}${p[5]}`;this.setLayoutProperty(g.id,"text-field",l)}}}))}setSecondaryLanguage(t=y.secondaryLanguage){v(t)&&(this.secondaryLanguage=t,this.onStyleReady(()=>{if(t===L.AUTO)return this.setSecondaryLanguage(b());const e=this.getStyle().layers,n=/^\s*{\s*name\s*(:\s*(\S*))?\s*}$/,s=/^\s*name\s*(:\s*(\S*))?\s*$/,d=/^\s*{\s*name\s*(:\s*(\S*))?\s*}(\s*){\s*name\s*(:\s*(\S*))?\s*}$/;let u;for(let h=0;h<e.length;h+=1){const o=e[h],m=o.layout;if(!m||!m["text-field"])continue;const g=this.getLayoutProperty(o.id,"text-field");let c;if(Array.isArray(g)&&g.length>=2&&g[0].trim().toLowerCase()==="concat"){c=g.slice();let i=0;for(let p=0;p<g.length;p+=1){const l=g[p];if((typeof l=="string"||l instanceof String)&&n.exec(l.toString())){if(i===1){c[p]=`{name:${t}}`;break}i+=1}else if(Array.isArray(l)&&l.length>=2&&l[0].trim().toLowerCase()==="get"&&s.exec(l[1].toString())){if(i===1){c[p][1]=`name:${t}`;break}i+=1}else if(Array.isArray(l)&&l.length===4&&l[0].trim().toLowerCase()==="case"){if(i===1){c[p]=["get",`name:${t}`];break}i+=1}}this.setLayoutProperty(o.id,"text-field",c)}else if((typeof g=="string"||g instanceof String)&&(u=d.exec(g.toString()))!==null){const i=t?`name:${t}`:"name";c=`{name${u[1]||""}}${u[3]}{${i}}`,this.setLayoutProperty(o.id,"text-field",c)}}}))}getPrimaryLanguage(){return this.primaryLanguage}getSecondaryLanguage(){return this.secondaryLanguage}getTerrainExaggeration(){return this.terrainExaggeration}hasTerrain(){return this.isTerrainEnabled}growTerrain(t,e=1e3){if(!this.terrain)return;const n=performance.now(),s=this.terrain.exaggeration,d=t-s,u=()=>{if(!this.terrain||this.terrainFlattening)return;const h=(performance.now()-n)/e;if(h<.99){const o=1-Math.pow(1-h,4),m=s+o*d;this.terrain.exaggeration=m,requestAnimationFrame(u)}else this.terrainGrowing=!1,this.terrainFlattening=!1,this.terrain.exaggeration=t;this.triggerRepaint()};this.terrainGrowing=!0,this.terrainFlattening=!1,requestAnimationFrame(u)}enableTerrain(t=this.terrainExaggeration){if(t<0){console.warn("Terrain exaggeration cannot be negative.");return}const e=s=>_(this,null,function*(){!this.terrain||s.type!=="data"||s.dataType!=="source"||!("source"in s)||s.sourceId!=="maptiler-terrain"||s.source.type!=="raster-dem"||s.isSourceLoaded&&(this.off("data",e),this.growTerrain(t))}),n=()=>{this.isTerrainEnabled=!0,this.terrainExaggeration=t,this.on("data",e),this.addSource(y.terrainSourceId,{type:"raster-dem",url:y.terrainSourceURL}),this.setTerrain({source:y.terrainSourceId,exaggeration:0})};if(this.getTerrain()){this.isTerrainEnabled=!0,this.growTerrain(t);return}this.loaded()||this.isTerrainEnabled?n():this.once("load",()=>{this.getTerrain()&&this.getSource(y.terrainSourceId)||n()})}disableTerrain(){if(!this.terrain)return;this.isTerrainEnabled=!1;const t=1*1e3,e=performance.now(),n=this.terrain.exaggeration,s=()=>{if(!this.terrain||this.terrainGrowing)return;const d=(performance.now()-e)/t;if(d<.99){const u=Math.pow(1-d,4),h=n*u;this.terrain.exaggeration=h,requestAnimationFrame(s)}else this.terrain.exaggeration=0,this.terrainGrowing=!1,this.terrainFlattening=!1,this.setTerrain(null),this.getSource(y.terrainSourceId)&&this.removeSource(y.terrainSourceId);this.triggerRepaint()};this.terrainGrowing=!1,this.terrainFlattening=!0,requestAnimationFrame(s)}setTerrainExaggeration(t,e=!0){!e&&this.terrain?(this.terrainExaggeration=t,this.terrain.exaggeration=t,this.triggerRepaint()):this.enableTerrain(t)}onStyleReady(t){this.isStyleLoaded()?t():this.once("styledata",()=>{t()})}fitToIpBounds(){return _(this,null,function*(){const t=yield w.info();this.fitBounds(t.country_bounds,{duration:0,padding:100})})}centerOnIpPoint(t){return _(this,null,function*(){const e=yield w.info();this.jumpTo({center:[e.longitude,e.latitude],zoom:t||11})})}getCameraHash(){const t=new Float32Array(5),e=this.getCenter();return t[0]=e.lng,t[1]=e.lat,t[2]=this.getZoom(),t[3]=this.getPitch(),t[4]=this.getBearing(),q.fromUint8Array(new Uint8Array(t.buffer))}getSdkConfig(){return A}getMaptilerSessionId(){return V}}class xt extends a.Marker{addTo(t){return super.addTo(t)}}class Ct extends a.Popup{addTo(t){return super.addTo(t)}}class Tt extends a.Style{constructor(t,e={}){super(t,e)}}class bt extends a.CanvasSource{onAdd(t){super.onAdd(t)}}class It extends a.GeoJSONSource{onAdd(t){super.onAdd(t)}}class wt extends a.ImageSource{onAdd(t){super.onAdd(t)}}class vt extends a.RasterTileSource{onAdd(t){super.onAdd(t)}}class Et extends a.RasterDEMTileSource{onAdd(t){super.onAdd(t)}}class Nt extends a.VectorTileSource{onAdd(t){super.onAdd(t)}}class Rt extends a.VideoSource{onAdd(t){super.onAdd(t)}}class Pt extends a.TerrainControl{onAdd(t){return super.onAdd(t)}}class C{constructor(t,e){this.x=t,this.y=e}_matMult(t){const e=t[0]*this.x+t[1]*this.y,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,this}_add(t){return this.x+=t.x,this.y+=t.y,this}_sub(t){return this.x-=t.x,this.y-=t.y,this}_mult(t){return this.x*=t,this.y*=t,this}_div(t){return this.x/=t,this.y/=t,this}_multByPoint(t){return this.x*=t.x,this.y*=t.y,this}_divByPoint(t){return this.x/=t.x,this.y/=t.y,this}_unit(){return this._div(this.mag()),this}_perp(){const t=this.y;return this.y=this.x,this.x=-t,this}_rotate(t){const e=Math.cos(t),n=Math.sin(t),s=e*this.x-n*this.y,d=n*this.x+e*this.y;return this.x=s,this.y=d,this}_rotateAround(t,e){const n=Math.cos(t),s=Math.sin(t),d=e.x+n*(this.x-e.x)-s*(this.y-e.y),u=e.y+s*(this.x-e.x)+n*(this.y-e.y);return this.x=d,this.y=u,this}_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}clone(){return new C(this.x,this.y)}add(t){return this.clone()._add(t)}sub(t){return this.clone()._sub(t)}multByPoint(t){return this.clone()._multByPoint(t)}divByPoint(t){return this.clone()._divByPoint(t)}mult(t){return this.clone()._mult(t)}div(t){return this.clone()._div(t)}rotate(t){return this.clone()._rotate(t)}rotateAround(t,e){return this.clone()._rotateAround(t,e)}matMult(t){return this.clone()._matMult(t)}unit(){return this.clone()._unit()}perp(){return this.clone()._perp()}round(){return this.clone()._round()}mag(){return Math.sqrt(this.x*this.x+this.y*this.y)}equals(t){return this.x===t.x&&this.y===t.y}dist(t){return Math.sqrt(this.distSqr(t))}distSqr(t){const e=t.x-this.x,n=t.y-this.y;return e*e+n*n}angle(){return Math.atan2(this.y,this.x)}angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)}angleWith(t){return this.angleWithSep(t.x,t.y)}angleWithSep(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)}static convert(t){return t instanceof C?t:Array.isArray(t)?new C(t[0],t[1]):t}}const{supported:Mt,setRTLTextPlugin:Ot,getRTLTextPluginStatus:Ut,LngLat:kt,LngLatBounds:Bt,MercatorCoordinate:$t,Evented:Gt,AJAXError:Ht,prewarm:jt,clearPrewarmedResources:Kt,version:Ft,workerCount:Dt,maxParallelImageRequests:Vt,workerUrl:zt,addProtocol:qt,removeProtocol:Wt}=a,Jt=a.Map,Zt=a.Marker,Yt=a.Popup,Xt=a.Style,Qt=a.CanvasSource,te=a.GeoJSONSource,ee=a.ImageSource,re=a.RasterTileSource,ie=a.RasterDEMTileSource,ne=a.VectorTileSource,ae=a.VideoSource;a.NavigationControl,a.GeolocateControl,a.AttributionControl,a.LogoControl,a.ScaleControl,a.FullscreenControl,a.TerrainControl;export{Ht as AJAXError,H as AttributionControl,bt as CanvasSource,Qt as CanvasSourceMLGL,Gt as Evented,K as FullscreenControl,It as GeoJSONSource,te as GeoJSONSourceMLGL,O as GeolocateControl,z as GeolocationType,wt as ImageSource,ee as ImageSourceMLGL,L as Language,me as LanguageGeocoding,kt as LngLat,Bt as LngLatBounds,N as LogoControl,St as Map,Jt as MapMLGL,ye as MapStyle,Ae as MapStyleVariant,G as MaptilerGeolocateControl,I as MaptilerLogoControl,P as MaptilerTerrainControl,xt as Marker,Zt as MarkerMLGL,$t as MercatorCoordinate,M as NavigationControl,C as Point,Ct as Popup,Yt as PopupMLGL,Et as RasterDEMTileSource,ie as RasterDEMTileSourceMLGL,vt as RasterTileSource,re as RasterTileSourceMLGL,fe as ReferenceMapStyle,j as ScaleControl,E as SdkConfig,Le as ServiceError,Tt as Style,Xt as StyleMLGL,Pt as TerrainControl,Nt as VectorTileSource,ne as VectorTileSourceMLGL,Rt as VideoSource,ae as VideoSourceMLGL,qt as addProtocol,Kt as clearPrewarmedResources,A as config,_e as coordinates,Se as data,xe as geocoding,Ce as geolocation,Ut as getRTLTextPluginStatus,Vt as maxParallelImageRequests,jt as prewarm,Wt as removeProtocol,Ot as setRTLTextPlugin,Te as staticMaps,Mt as supported,Ft as version,Dt as workerCount,zt as workerUrl};
|
|
1
|
+
import a from"maplibre-gl";export*from"maplibre-gl";import{Base64 as W}from"js-base64";import{v4 as J}from"uuid";import Z from"events";import{config as T,expandMapStyle as Y,MapStyleVariant as X,ReferenceMapStyle as Q,MapStyle as tt,mapStylePresetList as et,geolocation as w}from"@maptiler/client";import{LanguageGeocoding as me,MapStyle as ye,MapStyleVariant as Ae,ReferenceMapStyle as fe,ServiceError as Le,coordinates as _e,data as Se,geocoding as xe,geolocation as Ce,staticMaps as Te}from"@maptiler/client";const L={AUTO:"auto",LATIN:"latin",NON_LATIN:"nonlatin",LOCAL:"",ALBANIAN:"sq",AMHARIC:"am",ARABIC:"ar",ARMENIAN:"hy",AZERBAIJANI:"az",BASQUE:"eu",BELORUSSIAN:"be",BOSNIAN:"bs",BRETON:"br",BULGARIAN:"bg",CATALAN:"ca",CHINESE:"zh",CORSICAN:"co",CROATIAN:"hr",CZECH:"cs",DANISH:"da",DUTCH:"nl",ENGLISH:"en",ESPERANTO:"eo",ESTONIAN:"et",FINNISH:"fi",FRENCH:"fr",FRISIAN:"fy",GEORGIAN:"ka",GERMAN:"de",GREEK:"el",HEBREW:"he",HINDI:"hi",HUNGARIAN:"hu",ICELANDIC:"is",INDONESIAN:"id",IRISH:"ga",ITALIAN:"it",JAPANESE:"ja",JAPANESE_HIRAGANA:"ja-Hira",JAPANESE_KANA:"ja_kana",JAPANESE_LATIN:"ja_rm",JAPANESE_2018:"ja-Latn",KANNADA:"kn",KAZAKH:"kk",KOREAN:"ko",KOREAN_LATIN:"ko-Latn",KURDISH:"ku",ROMAN_LATIN:"la",LATVIAN:"lv",LITHUANIAN:"lt",LUXEMBOURGISH:"lb",MACEDONIAN:"mk",MALAYALAM:"ml",MALTESE:"mt",NORWEGIAN:"no",OCCITAN:"oc",POLISH:"pl",PORTUGUESE:"pt",ROMANIAN:"ro",ROMANSH:"rm",RUSSIAN:"ru",SCOTTISH_GAELIC:"gd",SERBIAN_CYRILLIC:"sr",SERBIAN_LATIN:"sr-Latn",SLOVAK:"sk",SLOVENE:"sl",SPANISH:"es",SWEDISH:"sv",TAMIL:"ta",TELUGU:"te",THAI:"th",TURKISH:"tr",UKRAINIAN:"uk",WELSH:"cy"},rt=new Set(Object.values(L));function v(r){return rt.has(r)}const it=new Set(Object.values(L));function b(){if(typeof navigator>"u")return Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0];const r=Array.from(new Set(navigator.languages.map(t=>t.split("-")[0]))).filter(t=>it.has(t));return r.length?r[0]:L.LATIN}let E=class extends Z{constructor(){super(),this.primaryLanguage=L.AUTO,this.secondaryLanguage=null,this.session=!0,this._unit="metric",this._apiKey=""}set unit(t){this._unit=t,this.emit("unit",t)}get unit(){return this._unit}set apiKey(t){this._apiKey=t,T.apiKey=t,this.emit("apiKey",t)}get apiKey(){return this._apiKey}set fetch(t){T.fetch=t}get fetch(){return T.fetch}};const A=new E,y={maptilerLogoURL:"https://api.maptiler.com/resources/logo.svg",maptilerURL:"https://www.maptiler.com/",maptilerApiHost:"api.maptiler.com",rtlPluginURL:"https://cdn.maptiler.com/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.min.js",primaryLanguage:L.AUTO,secondaryLanguage:L.LOCAL,terrainSourceURL:"https://api.maptiler.com/tiles/terrain-rgb-v2/tiles.json",terrainSourceId:"maptiler-terrain"};Object.freeze(y);class N extends a.LogoControl{onAdd(t){return super.onAdd(t)}}class I extends N{constructor(t={}){var e,n;super(t),this.logoURL="",this.linkURL="",this.logoURL=(e=t.logoURL)!=null?e:y.maptilerLogoURL,this.linkURL=(n=t.linkURL)!=null?n:y.maptilerURL}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=window.document.createElement("div"),this._container.className="maplibregl-ctrl";const e=window.document.createElement("a");return e.style.backgroundRepeat="no-repeat",e.style.cursor="pointer",e.style.display="block",e.style.height="23px",e.style.margin="0 0 -4px -4px",e.style.overflow="hidden",e.style.width="88px",e.style.backgroundImage=`url(${this.logoURL})`,e.style.backgroundSize="100px 30px",e.style.width="100px",e.style.height="30px",e.target="_blank",e.rel="noopener nofollow",e.href=this.linkURL,e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}}function nt(){a.getRTLTextPluginStatus()==="unavailable"&&a.setRTLTextPlugin(y.rtlPluginURL,null,!0)}function at(r,t){r.forEach(e=>{t[e]&&(t[e]=t[e].bind(t))})}function S(r,t,e){const n=window.document.createElement(r);return t!==void 0&&(n.className=t),e&&e.appendChild(n),n}function ot(r){r.parentNode&&r.parentNode.removeChild(r)}function R(r){return r?typeof r=="string"||r instanceof String?!r.startsWith("http")&&r.toLowerCase().includes(".json")?r:Y(r):r instanceof X?r.getExpandedStyleURL():r instanceof Q?r.getDefaultVariant().getExpandedStyleURL():r:tt[et[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL()}class P{constructor(){at(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(t){return this._map=t,this._container=S("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=S("button","maplibregl-ctrl-terrain",this._container),S("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){ot(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}_toggleTerrain(){this._map.hasTerrain()?this._map.disableTerrain():this._map.enableTerrain(),this._updateTerrainIcon()}_updateTerrainIcon(){this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.hasTerrain()?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))}}class M extends a.NavigationControl{onAdd(t){return super.onAdd(t)}}class O extends M{constructor(){super({showCompass:!0,showZoom:!0,visualizePitch:!0}),this._compass.removeEventListener("click",this._compass.clickFunction),this._compass.addEventListener("click",t=>{this._map.getPitch()===0?this._map.easeTo({pitch:Math.min(this._map.getMaxPitch(),80)}):this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})})}_createButton(t,e){const n=super._createButton(t,e);return n.clickFunction=e,n}_rotateCompassArrow(){const t=this.options.visualizePitch?`scale(${Math.min(1.5,1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5))}) rotateX(${Math.min(70,this._map.transform.pitch)}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=t}}class U extends a.GeolocateControl{onAdd(t){return super.onAdd(t)}}var st=Object.defineProperty,lt=Object.defineProperties,ct=Object.getOwnPropertyDescriptors,k=Object.getOwnPropertySymbols,ht=Object.prototype.hasOwnProperty,ut=Object.prototype.propertyIsEnumerable,B=(r,t,e)=>t in r?st(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,dt=(r,t)=>{for(var e in t||(t={}))ht.call(t,e)&&B(r,e,t[e]);if(k)for(var e of k(t))ut.call(t,e)&&B(r,e,t[e]);return r},gt=(r,t)=>lt(r,ct(t));const $=a.Marker,G=a.LngLat;class H extends U{constructor(){super(...arguments),this.lastUpdatedCenter=new G(0,0)}_updateCamera(t){const e=new G(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,s=this._map.getBearing(),d=gt(dt({bearing:s},this.options.fitBoundsOptions),{linear:!0}),u=this._map.getZoom();u>this.options.fitBoundsOptions.maxZoom&&(d.zoom=u),this._map.fitBounds(e.toBounds(n),d,{geolocateSource:!0});let h=!1;const o=()=>{h=!0};this._map.once("click",o),this._map.once("dblclick",o),this._map.once("dragstart",o),this._map.once("mousedown",o),this._map.once("touchstart",o),this._map.once("wheel",o),this._map.once("moveend",()=>{this._map.off("click",o),this._map.off("dblclick",o),this._map.off("dragstart",o),this._map.off("mousedown",o),this._map.off("touchstart",o),this._map.off("wheel",o),!h&&(this.lastUpdatedCenter=this._map.getCenter())})}_setupUI(t){if(this.lastUpdatedCenter=this._map.getCenter(),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this._geolocateButton=S("button","maplibregl-ctrl-geolocate",this._container),S("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",t===!1){const e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}else{const e=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=S("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new $(this._dotElement),this._circleElement=S("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new $({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("move",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("moveend",e=>{const n=e.originalEvent&&e.originalEvent.type==="resize",s=this.lastUpdatedCenter.distanceTo(this._map.getCenter());!e.geolocateSource&&this._watchState==="ACTIVE_LOCK"&&!n&&s>1&&(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new Event("trackuserlocationend")))})}_updateCircleRadius(){if(this._watchState!=="BACKGROUND"&&this._watchState!=="ACTIVE_LOCK")return;const t=[this._lastKnownPosition.coords.longitude,this._lastKnownPosition.coords.latitude],e=this._map.project(t),n=this._map.unproject([e.x,e.y]),s=this._map.unproject([e.x+20,e.y]),d=n.distanceTo(s)/20,u=Math.ceil(2*this._accuracy/d);this._circleElement.style.width=`${u}px`,this._circleElement.style.height=`${u}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}}class j extends a.AttributionControl{onAdd(t){return super.onAdd(t)}}class K extends a.ScaleControl{onAdd(t){return super.onAdd(t)}}class F extends a.FullscreenControl{onAdd(t){return super.onAdd(t)}}var pt=Object.defineProperty,mt=Object.defineProperties,yt=Object.getOwnPropertyDescriptors,D=Object.getOwnPropertySymbols,At=Object.prototype.hasOwnProperty,ft=Object.prototype.propertyIsEnumerable,V=(r,t,e)=>t in r?pt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Lt=(r,t)=>{for(var e in t||(t={}))At.call(t,e)&&V(r,e,t[e]);if(D)for(var e of D(t))ft.call(t,e)&&V(r,e,t[e]);return r},_t=(r,t)=>mt(r,yt(t)),_=(r,t,e)=>new Promise((n,s)=>{var d=o=>{try{h(e.next(o))}catch(m){s(m)}},u=o=>{try{h(e.throw(o))}catch(m){s(m)}},h=o=>o.done?n(o.value):Promise.resolve(o.value).then(d,u);h((e=e.apply(r,t)).next())});const z=J(),q={POINT:"POINT",COUNTRY:"COUNTRY"};class St extends a.Map{constructor(t){var e,n,s;t.apiKey&&(A.apiKey=t.apiKey);const d=R(t.style),u=location.hash;A.apiKey||console.warn("MapTiler Cloud API key is not set. Visit https://maptiler.com and try Cloud for free!"),super(_t(Lt({},t),{style:d,maplibreLogo:!1,transformRequest:c=>{let i=null;try{i=new URL(c)}catch{return{url:c,headers:{}}}return i.host===y.maptilerApiHost&&(i.searchParams.has("key")||i.searchParams.append("key",A.apiKey),A.session&&i.searchParams.append("mtsid",z)),{url:i.href,headers:{}}}})),this.isTerrainEnabled=!1,this.terrainExaggeration=1,this.primaryLanguage=null,this.secondaryLanguage=null,this.terrainGrowing=!1,this.terrainFlattening=!1,this.primaryLanguage=(e=t.language)!=null?e:A.primaryLanguage,this.secondaryLanguage=A.secondaryLanguage,this.terrainExaggeration=(n=t.terrainExaggeration)!=null?n:this.terrainExaggeration,this.once("styledata",()=>_(this,null,function*(){if(!t.geolocate||t.center||t.hash&&u)return;try{if(t.geolocate===q.COUNTRY){yield this.fitToIpBounds();return}}catch(i){console.warn(i.message)}let c=null;try{yield this.centerOnIpPoint(t.zoom),c=this.getCameraHash()}catch(i){console.warn(i.message)}(yield navigator.permissions.query({name:"geolocation"})).state==="granted"&&navigator.geolocation.getCurrentPosition(i=>{c===this.getCameraHash()&&(this.terrain?this.easeTo({center:[i.coords.longitude,i.coords.latitude],zoom:t.zoom||12,duration:2e3}):this.once("terrain",()=>{this.easeTo({center:[i.coords.longitude,i.coords.latitude],zoom:t.zoom||12,duration:2e3})}))},null,{maximumAge:24*3600*1e3,timeout:5e3,enableHighAccuracy:!1})})),this.on("styledata",()=>{this.setPrimaryLanguage(this.primaryLanguage),this.setSecondaryLanguage(this.secondaryLanguage)}),this.on("styledata",()=>{this.getTerrain()===null&&this.isTerrainEnabled&&this.enableTerrain(this.terrainExaggeration)}),this.once("load",()=>_(this,null,function*(){nt()})),this.once("load",()=>_(this,null,function*(){let c={logo:null};try{const i=Object.keys(this.style.sourceCaches).map(l=>this.getSource(l)).filter(l=>typeof l.url=="string"&&l.url.includes("tiles.json")),p=new URL(i[0].url);p.searchParams.has("key")||p.searchParams.append("key",A.apiKey),c=yield(yield fetch(p.href)).json()}catch{}if("logo"in c&&c.logo){const i=c.logo;this.addControl(new I({logoURL:i}),t.logoPosition),t.attributionControl===!1&&this.addControl(new j(t))}else t.maptilerLogo&&this.addControl(new I,t.logoPosition);if(t.scaleControl){const i=t.scaleControl===!0||t.scaleControl===void 0?"bottom-right":t.scaleControl,p=new K({unit:A.unit});this.addControl(p,i),A.on("unit",l=>{p.setUnit(l)})}if(t.navigationControl!==!1){const i=t.navigationControl===!0||t.navigationControl===void 0?"top-right":t.navigationControl;this.addControl(new O,i)}if(t.geolocateControl!==!1){const i=t.geolocateControl===!0||t.geolocateControl===void 0?"top-right":t.geolocateControl;this.addControl(new H({positionOptions:{enableHighAccuracy:!0,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!0,showAccuracyCircle:!0,showUserLocation:!0}),i)}if(t.terrainControl){const i=t.terrainControl===!0||t.terrainControl===void 0?"top-right":t.terrainControl;this.addControl(new P,i)}if(t.fullscreenControl){const i=t.fullscreenControl===!0||t.fullscreenControl===void 0?"top-right":t.fullscreenControl;this.addControl(new F({}),i)}}));let h=!1,o=!1,m=null;this.once("load",c=>{h=!0,o&&this.fire("loadWithTerrain",m)});const g=c=>{c.terrain&&(o=!0,m={type:"loadWithTerrain",target:this,terrain:c.terrain},this.off("terrain",g),h&&this.fire("loadWithTerrain",m))};this.on("terrain",g),t.terrain&&this.enableTerrain((s=t.terrainExaggeration)!=null?s:this.terrainExaggeration)}onLoadAsync(){return _(this,null,function*(){return new Promise((t,e)=>{if(this.loaded())return t(this);this.once("load",n=>{t(this)})})})}onLoadWithTerrainAsync(){return _(this,null,function*(){return new Promise((t,e)=>{if(this.loaded()&&this.terrain)return t(this);this.once("loadWithTerrain",n=>{t(this)})})})}setStyle(t,e){return super.setStyle(R(t),e)}setLanguage(t=y.primaryLanguage){if(t===L.AUTO)return this.setLanguage(b());this.setPrimaryLanguage(t)}setPrimaryLanguage(t=y.primaryLanguage){v(t)&&(this.primaryLanguage=t,this.onStyleReady(()=>{if(t===L.AUTO)return this.setPrimaryLanguage(b());const e=this.getStyle().layers,n=/^\s*{\s*name\s*(:\s*(\S*))?\s*}$/,s=/^\s*name\s*(:\s*(\S*))?\s*$/,d=/^\s*{\s*name\s*(:\s*(\S*))?\s*}(\s*){\s*name\s*(:\s*(\S*))?\s*}$/,u=/^(.*)({\s*name\s*(:\s*(\S*))?\s*})(.*)$/,h=t?`name:${t}`:"name",o=["case",["has",h],["get",h],["get","name:latin"]];for(let m=0;m<e.length;m+=1){const g=e[m],c=g.layout;if(!c||!c["text-field"])continue;const i=this.getLayoutProperty(g.id,"text-field");let p;if(Array.isArray(i)&&i.length>=2&&i[0].trim().toLowerCase()==="concat"){const l=i.slice();for(let x=0;x<i.length;x+=1){const f=i[x];if((typeof f=="string"||f instanceof String)&&n.exec(f.toString())){l[x]=o;break}else if(Array.isArray(f)&&f.length>=2&&f[0].trim().toLowerCase()==="get"&&s.exec(f[1].toString())){l[x]=o;break}else if(Array.isArray(f)&&f.length===4&&f[0].trim().toLowerCase()==="case"){l[x]=o;break}}this.setLayoutProperty(g.id,"text-field",l)}else if(Array.isArray(i)&&i.length>=2&&i[0].trim().toLowerCase()==="get"&&s.exec(i[1].toString())){const l=o;this.setLayoutProperty(g.id,"text-field",l)}else if((typeof i=="string"||i instanceof String)&&n.exec(i.toString())){const l=o;this.setLayoutProperty(g.id,"text-field",l)}else if(Array.isArray(i)&&i.length===4&&i[0].trim().toLowerCase()==="case"){const l=o;this.setLayoutProperty(g.id,"text-field",l)}else if((typeof i=="string"||i instanceof String)&&(p=d.exec(i.toString()))!==null){const l=`{${h}}${p[3]}{name${p[4]||""}}`;this.setLayoutProperty(g.id,"text-field",l)}else if((typeof i=="string"||i instanceof String)&&(p=u.exec(i.toString()))!==null){const l=`${p[1]}{${h}}${p[5]}`;this.setLayoutProperty(g.id,"text-field",l)}}}))}setSecondaryLanguage(t=y.secondaryLanguage){v(t)&&(this.secondaryLanguage=t,this.onStyleReady(()=>{if(t===L.AUTO)return this.setSecondaryLanguage(b());const e=this.getStyle().layers,n=/^\s*{\s*name\s*(:\s*(\S*))?\s*}$/,s=/^\s*name\s*(:\s*(\S*))?\s*$/,d=/^\s*{\s*name\s*(:\s*(\S*))?\s*}(\s*){\s*name\s*(:\s*(\S*))?\s*}$/;let u;for(let h=0;h<e.length;h+=1){const o=e[h],m=o.layout;if(!m||!m["text-field"])continue;const g=this.getLayoutProperty(o.id,"text-field");let c;if(Array.isArray(g)&&g.length>=2&&g[0].trim().toLowerCase()==="concat"){c=g.slice();let i=0;for(let p=0;p<g.length;p+=1){const l=g[p];if((typeof l=="string"||l instanceof String)&&n.exec(l.toString())){if(i===1){c[p]=`{name:${t}}`;break}i+=1}else if(Array.isArray(l)&&l.length>=2&&l[0].trim().toLowerCase()==="get"&&s.exec(l[1].toString())){if(i===1){c[p][1]=`name:${t}`;break}i+=1}else if(Array.isArray(l)&&l.length===4&&l[0].trim().toLowerCase()==="case"){if(i===1){c[p]=["get",`name:${t}`];break}i+=1}}this.setLayoutProperty(o.id,"text-field",c)}else if((typeof g=="string"||g instanceof String)&&(u=d.exec(g.toString()))!==null){const i=t?`name:${t}`:"name";c=`{name${u[1]||""}}${u[3]}{${i}}`,this.setLayoutProperty(o.id,"text-field",c)}}}))}getPrimaryLanguage(){return this.primaryLanguage}getSecondaryLanguage(){return this.secondaryLanguage}getTerrainExaggeration(){return this.terrainExaggeration}hasTerrain(){return this.isTerrainEnabled}growTerrain(t,e=1e3){if(!this.terrain)return;const n=performance.now(),s=this.terrain.exaggeration,d=t-s,u=()=>{if(!this.terrain||this.terrainFlattening)return;const h=(performance.now()-n)/e;if(h<.99){const o=1-Math.pow(1-h,4),m=s+o*d;this.terrain.exaggeration=m,requestAnimationFrame(u)}else this.terrainGrowing=!1,this.terrainFlattening=!1,this.terrain.exaggeration=t;this.triggerRepaint()};this.terrainGrowing=!0,this.terrainFlattening=!1,requestAnimationFrame(u)}enableTerrain(t=this.terrainExaggeration){if(t<0){console.warn("Terrain exaggeration cannot be negative.");return}const e=s=>_(this,null,function*(){!this.terrain||s.type!=="data"||s.dataType!=="source"||!("source"in s)||s.sourceId!=="maptiler-terrain"||s.source.type!=="raster-dem"||s.isSourceLoaded&&(this.off("data",e),this.growTerrain(t))}),n=()=>{this.isTerrainEnabled=!0,this.terrainExaggeration=t,this.on("data",e),this.addSource(y.terrainSourceId,{type:"raster-dem",url:y.terrainSourceURL}),this.setTerrain({source:y.terrainSourceId,exaggeration:0})};if(this.getTerrain()){this.isTerrainEnabled=!0,this.growTerrain(t);return}this.loaded()||this.isTerrainEnabled?n():this.once("load",()=>{this.getTerrain()&&this.getSource(y.terrainSourceId)||n()})}disableTerrain(){if(!this.terrain)return;this.isTerrainEnabled=!1;const t=1*1e3,e=performance.now(),n=this.terrain.exaggeration,s=()=>{if(!this.terrain||this.terrainGrowing)return;const d=(performance.now()-e)/t;if(d<.99){const u=Math.pow(1-d,4),h=n*u;this.terrain.exaggeration=h,requestAnimationFrame(s)}else this.terrain.exaggeration=0,this.terrainGrowing=!1,this.terrainFlattening=!1,this.setTerrain(null),this.getSource(y.terrainSourceId)&&this.removeSource(y.terrainSourceId);this.triggerRepaint()};this.terrainGrowing=!1,this.terrainFlattening=!0,requestAnimationFrame(s)}setTerrainExaggeration(t,e=!0){!e&&this.terrain?(this.terrainExaggeration=t,this.terrain.exaggeration=t,this.triggerRepaint()):this.enableTerrain(t)}onStyleReady(t){this.isStyleLoaded()?t():this.once("styledata",()=>{t()})}fitToIpBounds(){return _(this,null,function*(){const t=yield w.info();this.fitBounds(t.country_bounds,{duration:0,padding:100})})}centerOnIpPoint(t){return _(this,null,function*(){const e=yield w.info();this.jumpTo({center:[e.longitude,e.latitude],zoom:t||11})})}getCameraHash(){const t=new Float32Array(5),e=this.getCenter();return t[0]=e.lng,t[1]=e.lat,t[2]=this.getZoom(),t[3]=this.getPitch(),t[4]=this.getBearing(),W.fromUint8Array(new Uint8Array(t.buffer))}getSdkConfig(){return A}getMaptilerSessionId(){return z}}class xt extends a.Marker{addTo(t){return super.addTo(t)}}class Ct extends a.Popup{addTo(t){return super.addTo(t)}}class Tt extends a.Style{constructor(t,e={}){super(t,e)}}class bt extends a.CanvasSource{onAdd(t){super.onAdd(t)}}class It extends a.GeoJSONSource{onAdd(t){super.onAdd(t)}}class wt extends a.ImageSource{onAdd(t){super.onAdd(t)}}class vt extends a.RasterTileSource{onAdd(t){super.onAdd(t)}}class Et extends a.RasterDEMTileSource{onAdd(t){super.onAdd(t)}}class Nt extends a.VectorTileSource{onAdd(t){super.onAdd(t)}}class Rt extends a.VideoSource{onAdd(t){super.onAdd(t)}}class Pt extends a.TerrainControl{onAdd(t){return super.onAdd(t)}}class C{constructor(t,e){this.x=t,this.y=e}_matMult(t){const e=t[0]*this.x+t[1]*this.y,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,this}_add(t){return this.x+=t.x,this.y+=t.y,this}_sub(t){return this.x-=t.x,this.y-=t.y,this}_mult(t){return this.x*=t,this.y*=t,this}_div(t){return this.x/=t,this.y/=t,this}_multByPoint(t){return this.x*=t.x,this.y*=t.y,this}_divByPoint(t){return this.x/=t.x,this.y/=t.y,this}_unit(){return this._div(this.mag()),this}_perp(){const t=this.y;return this.y=this.x,this.x=-t,this}_rotate(t){const e=Math.cos(t),n=Math.sin(t),s=e*this.x-n*this.y,d=n*this.x+e*this.y;return this.x=s,this.y=d,this}_rotateAround(t,e){const n=Math.cos(t),s=Math.sin(t),d=e.x+n*(this.x-e.x)-s*(this.y-e.y),u=e.y+s*(this.x-e.x)+n*(this.y-e.y);return this.x=d,this.y=u,this}_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}clone(){return new C(this.x,this.y)}add(t){return this.clone()._add(t)}sub(t){return this.clone()._sub(t)}multByPoint(t){return this.clone()._multByPoint(t)}divByPoint(t){return this.clone()._divByPoint(t)}mult(t){return this.clone()._mult(t)}div(t){return this.clone()._div(t)}rotate(t){return this.clone()._rotate(t)}rotateAround(t,e){return this.clone()._rotateAround(t,e)}matMult(t){return this.clone()._matMult(t)}unit(){return this.clone()._unit()}perp(){return this.clone()._perp()}round(){return this.clone()._round()}mag(){return Math.sqrt(this.x*this.x+this.y*this.y)}equals(t){return this.x===t.x&&this.y===t.y}dist(t){return Math.sqrt(this.distSqr(t))}distSqr(t){const e=t.x-this.x,n=t.y-this.y;return e*e+n*n}angle(){return Math.atan2(this.y,this.x)}angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)}angleWith(t){return this.angleWithSep(t.x,t.y)}angleWithSep(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)}static convert(t){return t instanceof C?t:Array.isArray(t)?new C(t[0],t[1]):t}}const{supported:Mt,setRTLTextPlugin:Ot,getRTLTextPluginStatus:Ut,LngLat:kt,LngLatBounds:Bt,MercatorCoordinate:$t,Evented:Gt,AJAXError:Ht,prewarm:jt,clearPrewarmedResources:Kt,version:Ft,workerCount:Dt,maxParallelImageRequests:Vt,workerUrl:zt,addProtocol:qt,removeProtocol:Wt}=a,Jt=a.Map,Zt=a.Marker,Yt=a.Popup,Xt=a.Style,Qt=a.CanvasSource,te=a.GeoJSONSource,ee=a.ImageSource,re=a.RasterTileSource,ie=a.RasterDEMTileSource,ne=a.VectorTileSource,ae=a.VideoSource;a.NavigationControl,a.GeolocateControl,a.AttributionControl,a.LogoControl,a.ScaleControl,a.FullscreenControl,a.TerrainControl;export{Ht as AJAXError,j as AttributionControl,bt as CanvasSource,Qt as CanvasSourceMLGL,Gt as Evented,F as FullscreenControl,It as GeoJSONSource,te as GeoJSONSourceMLGL,U as GeolocateControl,q as GeolocationType,wt as ImageSource,ee as ImageSourceMLGL,L as Language,me as LanguageGeocoding,kt as LngLat,Bt as LngLatBounds,N as LogoControl,St as Map,Jt as MapMLGL,ye as MapStyle,Ae as MapStyleVariant,H as MaptilerGeolocateControl,I as MaptilerLogoControl,O as MaptilerNavigationControl,P as MaptilerTerrainControl,xt as Marker,Zt as MarkerMLGL,$t as MercatorCoordinate,M as NavigationControl,C as Point,Ct as Popup,Yt as PopupMLGL,Et as RasterDEMTileSource,ie as RasterDEMTileSourceMLGL,vt as RasterTileSource,re as RasterTileSourceMLGL,fe as ReferenceMapStyle,K as ScaleControl,E as SdkConfig,Le as ServiceError,Tt as Style,Xt as StyleMLGL,Pt as TerrainControl,Nt as VectorTileSource,ne as VectorTileSourceMLGL,Rt as VideoSource,ae as VideoSourceMLGL,qt as addProtocol,Kt as clearPrewarmedResources,A as config,_e as coordinates,Se as data,xe as geocoding,Ce as geolocation,Ut as getRTLTextPluginStatus,Vt as maxParallelImageRequests,jt as prewarm,Wt as removeProtocol,Ot as setRTLTextPlugin,Te as staticMaps,Mt as supported,Ft as version,Dt as workerCount,zt as workerUrl};
|
package/dist/maptiler-sdk.mjs
CHANGED
|
@@ -1693,5 +1693,5 @@ maplibregl__default.ScaleControl;
|
|
|
1693
1693
|
maplibregl__default.FullscreenControl;
|
|
1694
1694
|
maplibregl__default.TerrainControl;
|
|
1695
1695
|
|
|
1696
|
-
export { AJAXError, AttributionControl, CanvasSource, CanvasSourceMLGL, Evented, FullscreenControl, GeoJSONSource, GeoJSONSourceMLGL, GeolocateControl, GeolocationType, ImageSource, ImageSourceMLGL, Language, LngLat, LngLatBounds, LogoControl, Map, MapMLGL, MaptilerGeolocateControl, MaptilerLogoControl, MaptilerTerrainControl, Marker, MarkerMLGL, MercatorCoordinate, NavigationControl, Point, Popup, PopupMLGL, RasterDEMTileSource, RasterDEMTileSourceMLGL, RasterTileSource, RasterTileSourceMLGL, ScaleControl, SdkConfig, Style, StyleMLGL, TerrainControl, VectorTileSource, VectorTileSourceMLGL, VideoSource, VideoSourceMLGL, addProtocol, clearPrewarmedResources, config, getRTLTextPluginStatus, maxParallelImageRequests, prewarm, removeProtocol, setRTLTextPlugin, supported, version, workerCount, workerUrl };
|
|
1696
|
+
export { AJAXError, AttributionControl, CanvasSource, CanvasSourceMLGL, Evented, FullscreenControl, GeoJSONSource, GeoJSONSourceMLGL, GeolocateControl, GeolocationType, ImageSource, ImageSourceMLGL, Language, LngLat, LngLatBounds, LogoControl, Map, MapMLGL, MaptilerGeolocateControl, MaptilerLogoControl, MaptilerNavigationControl, MaptilerTerrainControl, Marker, MarkerMLGL, MercatorCoordinate, NavigationControl, Point, Popup, PopupMLGL, RasterDEMTileSource, RasterDEMTileSourceMLGL, RasterTileSource, RasterTileSourceMLGL, ScaleControl, SdkConfig, Style, StyleMLGL, TerrainControl, VectorTileSource, VectorTileSourceMLGL, VideoSource, VideoSourceMLGL, addProtocol, clearPrewarmedResources, config, getRTLTextPluginStatus, maxParallelImageRequests, prewarm, removeProtocol, setRTLTextPlugin, supported, version, workerCount, workerUrl };
|
|
1697
1697
|
//# sourceMappingURL=maptiler-sdk.mjs.map
|