mahal_map 2.0.1 → 2.0.2
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/README.md +204 -162
- package/dist/index.d.mts +22 -3
- package/dist/index.d.ts +22 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/dist/mahal_map.sdk.js +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as maplibre_gl from 'maplibre-gl';
|
|
1
2
|
import { Map, FlyToOptions, Marker } from 'maplibre-gl';
|
|
2
3
|
|
|
3
4
|
declare class CameraController {
|
|
@@ -263,10 +264,13 @@ type Maps3DCtor = (new (options: IMaps3DLayerOptions) => IMaps3DLayer) & {
|
|
|
263
264
|
styleUrl?(style?: string, base?: string): string;
|
|
264
265
|
/** Подключение к уже созданной карте; возвращает экземпляр с `ready`. */
|
|
265
266
|
enhance?(map: Map, options?: IMaps3DLayerOptions): IMaps3DLayer;
|
|
266
|
-
/**
|
|
267
|
+
/**
|
|
268
|
+
* MapLibre с платформы вместе со своим воркером. Возвращает то же, что
|
|
269
|
+
* `import * as maplibregl from "maplibre-gl"` — декларации гарантирует peerDependency.
|
|
270
|
+
*/
|
|
267
271
|
maplibre?(options?: {
|
|
268
272
|
base?: string;
|
|
269
|
-
}): Promise<
|
|
273
|
+
}): Promise<typeof maplibre_gl>;
|
|
270
274
|
readonly maplibreVersion?: string;
|
|
271
275
|
};
|
|
272
276
|
|
|
@@ -456,6 +460,7 @@ declare class MahalMap {
|
|
|
456
460
|
private maps3dReady?;
|
|
457
461
|
private buildingsEnabled;
|
|
458
462
|
private workerCheckTimer?;
|
|
463
|
+
private styleChangeHandler?;
|
|
459
464
|
private constructor();
|
|
460
465
|
private static getInstanceKey;
|
|
461
466
|
private static normalizeLanguage;
|
|
@@ -542,7 +547,21 @@ declare class MahalMap {
|
|
|
542
547
|
* Без Maps3D менять нечего — карта на запасном стиле, у него варианта по теме нет.
|
|
543
548
|
*/
|
|
544
549
|
setStyle(theme: Theme): void;
|
|
545
|
-
|
|
550
|
+
/**
|
|
551
|
+
* Адрес стиля по имени темы. mapOptions() — основной контракт (есть с 0.5.0);
|
|
552
|
+
* styleUrl остаётся запасным путём для сборок, где mapOptions ещё нет.
|
|
553
|
+
* Раньше здесь был только styleUrl, и сборка с одним mapOptions() тему не меняла.
|
|
554
|
+
*/
|
|
555
|
+
private resolvePlatformStyle;
|
|
556
|
+
/**
|
|
557
|
+
* Полная смена стиля уносит слои Maps3D вместе с ним — реестр умеет вернуть волю
|
|
558
|
+
* клиента, но только когда новый стиль уже загружен.
|
|
559
|
+
*
|
|
560
|
+
* Слушаем styledata, а не style.load: setStyle() идёт через дифф и style.load при
|
|
561
|
+
* этом не поднимает — с ним восстановление просто не случалось. styledata приходит
|
|
562
|
+
* многократно, поэтому ждём isStyleLoaded() и снимаем обработчик сами.
|
|
563
|
+
*/
|
|
564
|
+
private refreshLayersOnStyleChange;
|
|
546
565
|
/**
|
|
547
566
|
* Язык подписей приходит из стиля платформы, отдельных URL по языкам больше нет —
|
|
548
567
|
* метод только запоминает выбор для остальных сервисов SDK (поиск, роутинг).
|