I'm attempting to add the C.C. widget (4.9) to a container DIV in my app. It works fine when I instantiate the widget using the default options, e.g.:
var coordsWidget = new CoordinateConversion({
container: "coordsDiv",
view: view
});
However, when I try to add a custom coordinate format, I get an error in dojo.js that indicates some clash in naming of DOM nodes (I think)...
When I remove the container property, and add the C.C. widget directly to the MapView.UI, using the same code for adding of the custom coordinate format, it works fine.
Any thoughts? Attached is the full text of the error from the console for reference..
Solved! Go to Solution.
I've passed this on to the devs that work on this, but a fix for now is do it like the sample does.
coordsWidget.conversions.splice(
0,
0,
new Conversion({
format: spn
})
);
It seems to work as expected in that case.
Thanks!
Do you have a reproducible app to look at using jsbin or codepen?
Attached is a super simple app to illustrate the issue. I've also created a codepen of the same.. never used this site and not sure if others can view: 4.x Coordinate Conversion - Adding to DIV
I've passed this on to the devs that work on this, but a fix for now is do it like the sample does.
coordsWidget.conversions.splice(
0,
0,
new Conversion({
format: spn
})
);
It seems to work as expected in that case.
Thanks!
Awesome, thank you!