@nextgis/ol-map-adapter
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -667,3 +667,4 @@ (function (global, factory) { | ||
}; | ||
OlMapAdapter.prototype.addLayer = function (adapterDef, options) { | ||
OlMapAdapter.prototype.addLayer = function (adapterDef, options, baselayer) { | ||
var _this = this; | ||
var adapterEngine; | ||
@@ -674,8 +675,12 @@ if (typeof adapterDef === 'string') { | ||
if (adapterEngine) { | ||
var adapter = new adapterEngine(this.map, options); | ||
var layer$$1 = adapter.addLayer(options); | ||
var layerId = adapter.name; | ||
this._layers[layerId] = { layer: layer$$1, order: options.order || this._order++, onMap: false }; | ||
this._length++; | ||
return Promise.resolve(adapter); | ||
var adapter_1 = new adapterEngine(this.map, options); | ||
var layer_1 = adapter_1.addLayer(options); | ||
var addlayerFun = adapter_1.addLayer(options); | ||
var toResolve_1 = function () { | ||
var layerId = adapter_1.name; | ||
_this._layers[layerId] = { layer: layer_1, order: options.order || _this._order++, onMap: false }; | ||
_this._length++; | ||
return adapter_1; | ||
}; | ||
return addlayerFun.then ? addlayerFun.then(function () { return toResolve_1(); }) : Promise.resolve(toResolve_1()); | ||
} | ||
@@ -682,0 +687,0 @@ return Promise.reject('No adapter'); |
@@ -7,3 +7,3 @@ /// <reference types="node" /> | ||
import { OsmAdapter } from './layer-adapters/OsmAdapter'; | ||
import { MarkerAdapter } from './layer-adapters/markerAdapter'; | ||
import { MarkerAdapter } from './layer-adapters/MarkerAdapter'; | ||
interface LayerMem { | ||
@@ -51,3 +51,3 @@ order: number; | ||
isLayerOnTheMap(layerName: string): boolean; | ||
addLayer(adapterDef: any, options?: any): Promise<any>; | ||
addLayer(adapterDef: any, options?: any, baselayer?: boolean): any; | ||
removeLayer(layerName: string): void; | ||
@@ -54,0 +54,0 @@ showLayer(layerName: string): void; |
{ | ||
"name": "@nextgis/ol-map-adapter", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "", | ||
@@ -16,3 +16,3 @@ "main": "lib/ol-map-adapter.js", | ||
"devDependencies": { | ||
"@nextgis/webmap": "^0.2.0", | ||
"@nextgis/webmap": "^0.2.1", | ||
"rollup": "^0.66.2", | ||
@@ -43,3 +43,3 @@ "rollup-plugin-commonjs": "^9.1.5", | ||
"license": "GPL-3.0", | ||
"gitHead": "61ae3c665f8c4c345a51183d1f53745cda97ec56" | ||
"gitHead": "16ddb8f791196f047deb0e0ac17310e97e78ab19" | ||
} |
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
114407
10
789