The underlying map problem

263
8
Jump to solution
3 weeks ago
雪原高1027
New Contributor

Hello. In the previous project, I used the framework version 10.2.4, and the map displayed was in Chinese style. Now after migrating to the latest version, the map displayed now becomes full English annotation, which is different from the map display of the old version, as shown in the picture I uploaded. Could you tell me how to display the map in Chinese?

0 Kudos
1 Solution

Accepted Solutions
Ting
by Esri Contributor
Esri Contributor

Hi,

We are aware of this question and will provide a more detailed answer soon. Meanwhile, you can...

Thanks

View solution in original post

0 Kudos
8 Replies
Ting
by Esri Contributor
Esri Contributor

Hi,

We are aware of this question and will provide a more detailed answer soon. Meanwhile, you can...

Thanks

View solution in original post

0 Kudos
雪原高1027
New Contributor

Thank you for your reply. And then, I have another question. When I move or zoom the map, I was in "viewpointChangedHandler callback method to derive the self. The mapView. VisibleArea. Among other. Center. X", access to the coordinates of the inaccurate, and the actual coordinates deviation is very large. As is shown in

0 Kudos
Ting
by Esri Contributor
Esri Contributor

Hi,

Personally I never worked with mapping and positioning solutions for mainland China, but I've heard about the GCJ-02 coordinate system issue. See a few discussions below

Not sure if this is related to your problem, but it's worth a look. It hasn't been long since I joined Esri, so unfortunately I don't know if the coordinate system conversion is an issue or not in the Runtime. Did it work in 10.x version of Runtime?

Also, you may find it useful checking out GeoScene, the zh-cn localized version of Runtime provided by Esri's China subsidiary 易智瑞, as well as their support page.

They should be more acquainted with these China-specific issues and may provide help.

 

Hope it helps!

0 Kudos
雪原高1027
New Contributor

Hello, SORRY for replying to your message so late. First, this case works fine on 10.x. Then I found the method of converting GCJ-02 coordinates on the Internet, and there was still a big deviation after conversion. To be sure, latitude and longitude is indeed in the self. The mapView. ViewpointChangedHandler get in this method, I'm not sure where is the problem really appear, request your help.

0 Kudos
Ting
by Esri Contributor
Esri Contributor

Want to make sure I get your question correct. Do you mean...

  • The mapView.locationDisplay.location is inaccurate comparing to the real coordinates of the device?
  • Or the mapPoint received from geoView(_ geoView: AGSGeoView, didTapAtScreenPoint screenPoint: CGPoint, mapPoint: AGSPoint) delegate method is inaccurate?

This shouldn't be related to the viewpointChangedHandler callback. A view point is only related to the map display, not to the underlying coordinates of a map point or a device.

You can also describe your problem again in 中文 if it helps.

0 Kudos
雪原高1027
New Contributor

你好,我这边的情况是当移动或者缩放地图时,

self.mapView.viewpointChangedHandler = ^{}该方法会回调,我在该方法里面通过

weakSelf.mapView.visibleArea.extent.center.x和

weakSelf.mapView.visibleArea.extent.center.y

获取经纬度,获取到的经纬度如截图所示“经度 13380673.030453-- 纬度 3537190.484881”,该经纬度明显不对,请问该问题的原因是?

0 Kudos
Ting
by Esri Contributor
Esri Contributor

地图上点坐标的Spatial Reference是与地图相同的。你的截图里的坐标看起来像是使用的Web Mercator投影的坐标。由于历史原因,电子设备的平面地图大多使用的是WebMercator投影。不知道你所指的经纬度偏差是不是因为这个原因?转换成WGS 84坐标后就是常见的东经北纬的数值了。

It looks like the coordinates in your screenshot are in WebMercator spatial reference. 

The following code convert them into WGS 84.

if let center = mapView.currentViewpoint(with: .centerAndScale)?.targetGeometry {
    let wgs84Point = AGSGeometryEngine.projectGeometry(center, to: .wgs84()) as! AGSPoint
    print(wgs84Point)
}

Please refer to this post for more ways of getting the center point of current map: https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/unable-to-get-current-map-center-... 

Feel free to let me know if it is not the case.

0 Kudos
Ting
by Esri Contributor
Esri Contributor

@MiaogengZhang Sorry to call you out of the blue. Do you happen to know sth about this issue? Thanks.

0 Kudos