1

I'm trying to make map center on certain Latitude/Longitude but Esri map control uses it's own X/Y coordinate system.

control.MapControl.PanTo(new MapPoint(control.MapCenter.Latitude, control.MapCenter.Longitude));

This code does not work. Is there any "conversion" routine to get MapPoint out of Lat/Lon or what should I do?

4

1 に答える 1

1

緯度/経度 (空間参照 4326) から Esri 座標 (空間参照 102100) への変換に使用する方法は次のとおりです。

// Create mappoint with lat/long coordinates
var mapPoint = new MapPoint(long, lat);

// Need to convert from Lat/Long to Esri
var webMercator = new WebMercator();
var converted = (MapPoint) webMercator.FromGeographic(mapPoint);

変換手順を実行する前に、の空間参照をチェックして、変換mapPointが必要かどうかを確認することもできます。

于 2014-10-17T16:59:06.457 に答える