Skip to content

Commit

Permalink
Fix IdTool breaking MeasureTool
Browse files Browse the repository at this point in the history
  • Loading branch information
tariqksoliman committed Aug 1, 2024
1 parent 138c59f commit dd8c5a1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/essence/Tools/Identifier/IdentifierTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ var IdentifierTool = {
}
},
make: function (targetId) {
this.MMWebGISInterface = new interfaceWithMMWebGIS()
this.targetId = targetId
this.MMWebGISInterface = new interfaceWithMMWebGIS()
this.activeLayerNames = []

L_.subscribeOnLayerToggle('IdentifierTool', () => {
Expand Down Expand Up @@ -467,7 +467,8 @@ var IdentifierTool = {
var decPlacesBefore = decSplit[0] ? decSplit[0].length : 0
var decPlacesAfter = decSplit[1] ? decSplit[1].length : 0
if (decPlacesBefore <= 5) {
if (scalefactor != undefined) v = v * parseFloat(scalefactor)
if (scalefactor != undefined)
v = v * parseFloat(scalefactor)
if (sigfigs != undefined) v = v.toFixed(sigfigs)
}
v = parseFloat(v)
Expand All @@ -485,18 +486,19 @@ function interfaceWithMMWebGIS() {
this.separateFromMMWebGIS = function () {
separateFromMMWebGIS()
}

//MMWebGIS should always have a div with id 'tools'
var tools = d3.select('#tools')
//Clear it
tools.selectAll('*').remove()
//Add a semantic container
tools = tools
.append('div')
.attr('class', 'center aligned ui padded grid')
.style('height', '100%')
//Add the markup to tools or do it manually
//tools.html( markup );
if (IdentifierTool.targetId !== 'toolContentSeparated_Identifier') {
//MMWebGIS should always have a div with id 'tools'
var tools = d3.select('#tools')
//Clear it
tools.selectAll('*').remove()
//Add a semantic container
tools = tools
.append('div')
.attr('class', 'center aligned ui padded grid')
.style('height', '100%')
//Add the markup to tools or do it manually
//tools.html( markup );
}

//Add event functions and whatnot
var previousCursor = d3.select('#map').style('cursor')
Expand Down
1 change: 1 addition & 0 deletions src/essence/Tools/Measure/MeasureTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ let MeasureTool = {
MeasureTool.data = []
MeasureTool.lastData = []
MeasureTool.datasetMapping = []
MeasureTool.uniformData = []
distDisplayUnit = 'meters'
steps = 100

Expand Down

0 comments on commit dd8c5a1

Please sign in to comment.