Select to view content in your preferred language

how to build the polyline where Points crosses the international dateline

1112
2
04-18-2011 07:00 AM
NipaParikh
Deactivated User
Hi,

I've series of points that displays ship's locations as it moves.  I generate dynamic polyline from the series of the points.  But the problem I've having is there are ships that crosses the international dateline.  In that case I don't want to join points but instead generate two separate polylines on two sides.

Does anyone know how to do that?

I'm attaching the code on how I'm building the polyline dynamically.
Tags (2)
0 Kudos
2 Replies
NipaParikh
Deactivated User
Sorry, here is the attachment.
0 Kudos
MehulChoksey
Esri Contributor
In 2.3 release,
there is normalizeCentralMeridian method that you can use before adding graphic to graphicsLayer on the map.
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/utils/GeometryUtil.html#normalizeCentralMe...

pseudo code:

var geometryService:GeometryService = new GeometryService("http://myserver/arcgis/rest/services/Geometry/GeometryServer");
        private function Normalize():void {
            var normalizeResponder:AsyncResponder = new AsyncResponder(normalizeResult_Handler, normalizeFault_Handler)
            GeometryUtil.normalizeCentralMeridian([myGraphic.geometry],geometryService,normalizeResponder);
            }
        
        private function normalizeResult_Handler(geometries:Array,token:Object = null):void {
            for each (var geometry:Geometry in geometries){
                myGraphicsLayer.add(new Graphic(geometry));
            }
        }
        private function normalizeFault_Handler(geometries:Array,token:Object = null):void {
            
        }
0 Kudos