Skip to content
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
2 changes: 1 addition & 1 deletion plugins/beta/draw-es/src/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function attachEvents ({ pluginState, mapProvider, events, eventBus, butt

// Prevent self-intersect
// TODO - refactor this when rings and/or multipolygons are supported
if (toolInfoType === 'reshape') {
if (toolInfoType === 'reshape-stop') {
const isSimple = simplifyOperator.isSimple(graphic.geometry) && graphic.geometry.rings.length === 1
if (!isSimple) {
sketchViewModel.undo()
Expand Down
13 changes: 13 additions & 0 deletions plugins/datasets/src/adapters/esri/esriLayerAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,21 @@ export default class EsriLayerAdapter extends LayerAdapter {

// Finally show all layers that are visible based on the dataset/mapStyle visibility
await Promise.all(topLevelDatasets.map(registryDataset => this.applyDatasetVisibility(registryDataset.id)))
this._reorderLayers()
this.resolveReady()
}

_reorderLayers () {
// Ensure that all sketch layers are on top of the map, so that they are not obscured by other layers
// Only applicable when the draw plugin is in use, but safe to call regardless
const layersLength = this._map?.allLayers?.items?.length
if (layersLength) {
this._map.allLayers.items
.filter((layer) => layer.id.includes('ketchLayer'))
.forEach((layer) => this._map.reorder(layer, layersLength))
}
}

_addGroupLayer (esriGroupId) {
// Either adds a new group layer to the map, or returns an existing one if it already exists
if (!this._groupLayers[esriGroupId]) {
Expand Down Expand Up @@ -117,6 +129,7 @@ export default class EsriLayerAdapter extends LayerAdapter {
await this._addLayers(registryDataset)
const { parentId } = registryDataset
const vectorTileLayer = this._mapVisibilityLayers[parentId || datasetId]
this._reorderLayers()
this.applyDatasetOpacity(datasetId)
this._applyStyleLayerPaintProperties(registryDataset, vectorTileLayer)
this.applyDatasetVisibility(datasetId)
Expand Down
Loading