AnsweredAssumed Answered

Polyline never cross the 180 meridian

Question asked by pbolduc on Dec 8, 2017
Latest reply on Dec 16, 2017 by JamieHH

Hi,

 

When I try to draw a polyline that cross the 180 meridian, the polyline always go across the earth instead of crossing the 180 meridian as I would expect. I am using the 100.1 version of Android ArcGIS runtime.

 

Here is an example to reproduce the issue and a screenshot

public class PolylineAcross180MeridianActivity extends AppCompatActivity
{
    private MapView mapView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_polyline_across180_meridian);
        mapView = findViewById(R.id.map_view);

        mapView.setMap(new ArcGISMap(Basemap.createImagery()));
        final GraphicsOverlay overlay = new GraphicsOverlay();
        mapView.getGraphicsOverlays().add(overlay);
        final Point p1 = new Point(-170, 0.0, SpatialReferences.getWgs84());
        final Point p2 = new Point(170, 0.0, SpatialReferences.getWgs84());
        final Polyline polyline = new Polyline(new PointCollection(Lists.newArrayList(p1, p2)));
        final SimpleLineSymbol simpleLineSymbol = new SimpleLineSymbol(SimpleLineSymbol.Style.SOLID, getColor(android.R.color.holo_red_dark), 5f);
        overlay.getGraphics().add(new Graphic(polyline, simpleLineSymbol));
    }
}

 

Is it a way to have the polyline cross the 180 meridian ?

 

Regards,

 

Patrick

Outcomes