Skip to content

Commit

Permalink
#380 DrawTool - Fix error saving templateless features
Browse files Browse the repository at this point in the history
  • Loading branch information
tariqksoliman committed May 15, 2023
1 parent 223fd10 commit 8b9fd9e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
6 changes: 6 additions & 0 deletions src/essence/Ancillary/Description.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ const Description = {
})
},
updatePoint: function (activeLayer) {
if (
activeLayer == null ||
Description.L_.layers.data[activeLayer.options.layerName] == null
)
return

this.descCont.style('display', 'flex')
$('.mainDescription').animate(
{
Expand Down
5 changes: 4 additions & 1 deletion src/essence/Basics/Map_/Map_.js
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,10 @@ function clearOnMapClick(event) {
}

function checkBounds(layer) {
if (layer.feature.geometry.type.toLowerCase() === 'polygon') {
if (
layer.feature &&
layer.feature.geometry.type.toLowerCase() === 'polygon'
) {
if (
L.leafletPip.pointInLayer(
[latlng.lng, latlng.lat],
Expand Down
15 changes: 9 additions & 6 deletions src/essence/Tools/Draw/DrawTool_Editing.js
Original file line number Diff line number Diff line change
Expand Up @@ -2348,12 +2348,15 @@ var Editing = {
if (DrawTool.plugins?.Geologic?.custom?.resetGeologic)
DrawTool.plugins.Geologic.custom.resetGeologic()

const templaterProperties = templater.getValues(
L_.layers.layer[DrawTool.lastContextLayerIndexFileId.layer],
properties,
grouping ? true : false
)
if (templaterProperties === false) return
let templaterProperties = {}
if (templater) {
templaterProperties = templater.getValues(
L_.layers.layer[DrawTool.lastContextLayerIndexFileId.layer],
properties,
grouping ? true : false
)
if (templaterProperties === false) return
}

if (!grouping) {
//Then just a regular single save
Expand Down
2 changes: 1 addition & 1 deletion src/essence/Tools/Draw/DrawTool_Files.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ var Files = {
DrawTool.setDrawingType(drawType)
} else {
CursorInfo.update(
`Please select a file from the list below (by clicking on its name). If none exist, create one with the + above.`,
`Please select a file from the list below (by clicking on its name). If none exist, make one with the create button below.`,
6000,
false,
{
Expand Down

0 comments on commit 8b9fd9e

Please sign in to comment.