Hexagon Geospatial
MENU

Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Anonymous
Posts: 0

Portal SDK: showMeasure Parameter does nothing to draw the annotations/text.

Questions from a customer who is in the process of transitioning from logging Service Request to using the Community:

 

When using the following function, the showMeasure parameter does nothing to draw the annotations/text for the feature geometry segments.

 

$GP.map.draw({
"layerName": "layer1",
"showMeasure": 1,
"type": "Feature",
"geometry": geometry,
"style": PolygonStyle
});

 

where,
geometry is a relevant GeoJSON object, and
PolygonStyle is a suitable style

 

Also, while using the following methods it doesn't show measurements.

 

$GP.map.draw.point()
$GP.map.draw.path()
$GP.map.draw.circle()
$GP.map.draw.rectangle()
$GP.map.draw.arc()
$GP.map.draw.polygon()

 

As per documentation and API.js,
showMeasure should be provided with a numerical value.
Even after doing so, it doesn't draw the measurements for the drawn features.

Highlighted
Dd
Occasional Contributor
Posts: 14
Registered: ‎11-06-2017

Re: Portal SDK: showMeasure Parameter does nothing to draw the annotations/text.

I solved it like this:

 

$GP.map.draw.polygon({

showMeasure: true

}, function (r) {

console.log(r.feature.get_geoJSON());

});

Polls
Please register to vote
Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.