Skip to content

Commit

Permalink
feature: change the type of layertype.js to be layerType instead of t…
Browse files Browse the repository at this point in the history
…ype for VSCode syntax highlight compatibility (#1706)
  • Loading branch information
Grammostola authored Mar 6, 2023
1 parent 7d0edc3 commit 7506505
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions src/layer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import mapUtils from './maputils';
import group from './layer/group';
import type from './layer/layertype';
import layerType from './layer/layertype';

function onChangeVisible(e) {
const layer = e.target;
Expand Down Expand Up @@ -60,7 +60,7 @@ const Layer = function Layer(optOptions, viewer) {
}

if (layerOptions.type) {
const layer = type[layerOptions.type](layerOptions, viewer);
const layer = layerType[layerOptions.type](layerOptions, viewer);
layer.once('postrender', onChangeVisible);
return layer;
}
Expand All @@ -80,6 +80,6 @@ function groupLayer(options, viewer) {
throw new Error('Group layer has no layers');
}

type.GROUP = groupLayer;
layerType.GROUP = groupLayer;

export default Layer;
32 changes: 16 additions & 16 deletions src/layer/layertype.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ import osm from './osm';
import vectortile from './vectortile';
import feature from './featurelayer';

const type = {};
const layerType = {};

type.WFS = wfs;
type.AGS_FEATURE = agsFeature;
type.AGS_MAP = agsMap;
type.TOPOJSON = topojson;
type.GEOJSON = geojson;
type.GPX = gpx;
type.KML = kml;
type.WMS = wms;
type.WMTS = wmts;
type.AGS_TILE = agsTile;
type.XYZ = xyz;
type.OSM = osm;
type.VECTORTILE = vectortile;
type.FEATURE = feature;
layerType.WFS = wfs;
layerType.AGS_FEATURE = agsFeature;
layerType.AGS_MAP = agsMap;
layerType.TOPOJSON = topojson;
layerType.GEOJSON = geojson;
layerType.GPX = gpx;
layerType.KML = kml;
layerType.WMS = wms;
layerType.WMTS = wmts;
layerType.AGS_TILE = agsTile;
layerType.XYZ = xyz;
layerType.OSM = osm;
layerType.VECTORTILE = vectortile;
layerType.FEATURE = feature;

export default type;
export default layerType;

0 comments on commit 7506505

Please sign in to comment.