@mapless/core 0.0.1 → 0.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/dist/index.js
CHANGED
|
@@ -32,11 +32,11 @@ const STATUS_COLORS = {
|
|
|
32
32
|
const defaultTransformRequest = (url)=>({
|
|
33
33
|
url
|
|
34
34
|
});
|
|
35
|
-
const propwmsTransformRequest = ({
|
|
36
|
-
if (url.includes(
|
|
35
|
+
const propwmsTransformRequest = ({ filterUrl = '/api/v2/Propagation/Wms', getToken })=>(url)=>{
|
|
36
|
+
if (url.includes(filterUrl)) return {
|
|
37
37
|
url,
|
|
38
38
|
headers: {
|
|
39
|
-
Authorization: `Bearer ${
|
|
39
|
+
Authorization: `Bearer ${getToken()}`
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
return {
|
|
@@ -15569,13 +15569,7 @@ class StepManager extends EmitManager {
|
|
|
15569
15569
|
setupHoverHandler() {
|
|
15570
15570
|
const enterHandler = (e)=>{
|
|
15571
15571
|
if (!this.mapless || !e.features?.length) return;
|
|
15572
|
-
const feature = e.features[0];
|
|
15573
|
-
const geometry = feature.geometry;
|
|
15574
|
-
const coordinates = geometry?.coordinates.slice();
|
|
15575
|
-
const label = feature.properties?.label || '';
|
|
15576
|
-
const value = feature.properties?.value?.toFixed(2) || '';
|
|
15577
15572
|
this.mapless?.setCursor('pointer');
|
|
15578
|
-
console.log('mouseenter', coordinates, label, value);
|
|
15579
15573
|
};
|
|
15580
15574
|
this._listener?.add('mouseenter', this.idHub?.pointLayerId, enterHandler);
|
|
15581
15575
|
const leaveHandler = ()=>{
|
|
@@ -15589,7 +15583,6 @@ class StepManager extends EmitManager {
|
|
|
15589
15583
|
mouseMoveHandler = throttle((e)=>{
|
|
15590
15584
|
if (this.tempNode) {
|
|
15591
15585
|
e.preventDefault();
|
|
15592
|
-
console.log('mousemove', e.lngLat);
|
|
15593
15586
|
const dataLngLat = this.mapless?.coordTrans('tileToData', [
|
|
15594
15587
|
e.lngLat.lng,
|
|
15595
15588
|
e.lngLat.lat
|
|
@@ -33,7 +33,7 @@ declare class StepManager extends EmitManager<StepManagerEvents, StepIdHubType>
|
|
|
33
33
|
destroy: () => void;
|
|
34
34
|
}
|
|
35
35
|
export default StepManager;
|
|
36
|
-
export declare const attachStep: (mapless: Mapless | undefined, name?: string, options?: StepManagerOptions) => StepManager | undefined;
|
|
36
|
+
export declare const attachStep: (mapless: Mapless | undefined | null, name?: string, options?: StepManagerOptions) => StepManager | undefined;
|
|
37
37
|
export declare const getStep: (mapless: Mapless | undefined | null, name?: string) => StepManager | undefined;
|
|
38
38
|
export declare const detachStep: (mapless: Mapless | undefined | null, name?: string) => boolean | undefined;
|
|
39
39
|
//# sourceMappingURL=step.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../../src/Mapless/mana/step.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAY,MAAM,IAAI,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE5E,KAAK,aAAa,GAAG,SAAS,GAAG;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,cAAM,WAAY,SAAQ,WAAW,CAAC,iBAAiB,EAAE,aAAa,CAAC;IACrE,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,SAAS,CAAS;gBAEd,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,kBAAkB;IAajD,uBA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EAAE;IAetB,OAAO,CAAC,IAAI,EAAE,IAAI;IAoBlB,UAAU;IAKV,OAAO,CAAC,iBAAiB;IA4CzB,UAAU,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAQ;IACzC,gBAAgB,SAAO;IACvB,OAAO,CAAC,QAAQ,CAA+B;IAE/C,OAAO,CAAC,gBAAgB,CAiBjB;IAEP,OAAO,CAAC,cAAc,CAMpB;IAEF,OAAO,CAAC,gBAAgB;IAWxB,OAAO,CAAC,qBAAqB;IA0B7B,OAAO,CAAC,mBAAmB;IAkClB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAIlC,OAAO,aAGd;CACH;AAED,eAAe,WAAW,CAAC;AAE3B,eAAO,MAAM,UAAU,GACrB,SAAS,OAAO,GAAG,SAAS,GAAG,IAAI,EACnC,OAAO,MAAM,EACb,UAAU,kBAAkB,4BACe,CAAC;AAC9C,eAAO,MAAM,OAAO,GAAI,SAAS,OAAO,GAAG,SAAS,GAAG,IAAI,EAAE,OAAO,MAAM,4BACzC,CAAC;AAClC,eAAO,MAAM,UAAU,GACrB,SAAS,OAAO,GAAG,SAAS,GAAG,IAAI,EACnC,OAAO,MAAM,wBACuB,CAAC"}
|
|
@@ -2,8 +2,9 @@ import type { MaplessPresetType } from './types';
|
|
|
2
2
|
export declare const defaultTransformRequest: (url: string) => {
|
|
3
3
|
url: string;
|
|
4
4
|
};
|
|
5
|
-
export declare const propwmsTransformRequest: ({
|
|
6
|
-
|
|
5
|
+
export declare const propwmsTransformRequest: ({ filterUrl, getToken }: {
|
|
6
|
+
filterUrl: string;
|
|
7
|
+
getToken: () => string;
|
|
7
8
|
}) => (url: string) => {
|
|
8
9
|
url: string;
|
|
9
10
|
headers: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapless.d.ts","sourceRoot":"","sources":["../../../../src/Mapless/preset/mapless.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,eAAO,MAAM,uBAAuB,GAAI,KAAK,MAAM;;CAAc,CAAC;AAElE,eAAO,MAAM,uBAAuB,GAAI,
|
|
1
|
+
{"version":3,"file":"mapless.d.ts","sourceRoot":"","sources":["../../../../src/Mapless/preset/mapless.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,eAAO,MAAM,uBAAuB,GAAI,KAAK,MAAM;;CAAc,CAAC;AAElE,eAAO,MAAM,uBAAuB,GAAI,yBAGrC;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,MAAM,CAAC;CACxB,MACS,KAAK,MAAM;;;;;;;;CAWpB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,iBA0B3B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mapless/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Mapbox wrapper library without React dependencies",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"license": "MIT",
|
|
48
48
|
"repository": {
|
|
49
49
|
"type": "git",
|
|
50
|
-
"url": "https://github.com/mapless-io/mapless.git"
|
|
50
|
+
"url": "git+https://github.com/mapless-io/mapless.git"
|
|
51
51
|
},
|
|
52
52
|
"homepage": "https://github.com/mapless-io/mapless",
|
|
53
53
|
"bugs": {
|