Select to view content in your preferred language

I need to convert user-drawn polygons and their buffered polygons from web mercator to decimal degrees. I'm trying to adapt this section of code from the util_buffergraphic sample:

1992
1
04-22-2016 02:53 PM
StephenSavage
Deactivated User

This is what I have so far:

      array.forEach(bufferedGeometries, function(geometry) {
        var graphic = new Graphic(geometry, symbol);
        map.graphics.add(graphic);
        alert(geometry.rings);
      });

I can see the coordinates from geometry.rings, but I can't figure out how to send the geometry to the webMercatorToGeographic(geometry) routine and get anything back. 

0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Emeritus

Stephen,

It is simple as:

array.forEach(bufferedGeometries, function(geometry) {
    var graphic = new Graphic(webMercatorUtils.webMercatorToGeographic(geometry), symbol);
    map.graphics.add(graphic);
});