Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: change the type of layertype.js to be layerType instead of t… #1706

Merged
merged 1 commit into from
Mar 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;