@nextgis/webmap
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -11,4 +11,4 @@ import { Entry } from './Entry'; | ||
getParents(filterFunc?: (entry: Entry) => boolean): Entry[]; | ||
getDescendants(filterFunc?: (entry: Entry) => boolean): Entry[]; | ||
getDescendants(filterFunc?: (entry: Entry) => boolean): any[]; | ||
getChildren(): Entry[]; | ||
} |
@@ -34,2 +34,4 @@ /// <reference types="node" /> | ||
private _addLayerProviders; | ||
private _addEventsListeners; | ||
private _onMapClick; | ||
} |
@@ -0,1 +1,3 @@ | ||
import { MapClickEvent } from './MapAdapter'; | ||
import { WebMap } from '../webmap'; | ||
export interface TreeItem { | ||
@@ -35,2 +37,3 @@ item_type: 'root' | 'group' | 'layer'; | ||
getLayerAdapters?(): Promise<any>; | ||
onMapClick?(evt: MapClickEvent, webMap?: WebMap): any; | ||
} |
@@ -9,3 +9,3 @@ /// <reference types="node" /> | ||
} | ||
interface MapClickEvent { | ||
export interface MapClickEvent { | ||
latLng: LatLng; | ||
@@ -46,3 +46,7 @@ pixel: { | ||
onMapClick(evt: MapClickEvent): void; | ||
requestGeomString?(pixel: { | ||
top: number; | ||
left: number; | ||
}, pixelRadius?: number): string; | ||
} | ||
export {}; |
@@ -1152,2 +1152,3 @@ (function (global, factory) { | ||
this._starterKits = appOptions.starterKits || []; | ||
this._addEventsListeners(); | ||
} | ||
@@ -1333,2 +1334,15 @@ WebMap.prototype.create = function (options) { | ||
}; | ||
WebMap.prototype._addEventsListeners = function () { | ||
var _this = this; | ||
this.map.emitter.on('click', function (ev) { return _this._onMapClick(ev); }); | ||
}; | ||
WebMap.prototype._onMapClick = function (ev) { | ||
var _this = this; | ||
this.emitter.emit('click', ev); | ||
this._starterKits.forEach(function (x) { | ||
if (x.onMapClick) { | ||
x.onMapClick(ev, _this); | ||
} | ||
}); | ||
}; | ||
return WebMap; | ||
@@ -1335,0 +1349,0 @@ }()); |
{ | ||
"name": "@nextgis/webmap", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "", | ||
@@ -41,4 +41,3 @@ "main": "lib/webmap.js", | ||
], | ||
"license": "GPL-3.0", | ||
"gitHead": "1d92037f9eb3c6760a23640f24d30b448376f097" | ||
"license": "GPL-3.0" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
148583
1726
0