Flutter GoogleMaps ScreenCoordinates 映射

问题描述

我正在尝试构建一个小型示例应用程序,该应用程序使用 Google 地图和一个网络服务,提供有关特定 LatLng 位置集的土壤数据(png 地图)的信息。

webservice 的输入是 windowwidthpx、windowheightpx、screenwidthpx、mapimg_width、mapimg_height 和我希望获取土壤图的区域的 latlang 位置。 webservice 反过来返回一个 png,可以在 Flutter 中覆盖在 googlemaps 上。另外,我提供了 latlang 位置的屏幕坐标。

但是,我无法让叠加层按预期工作see the image here。我无法弄清楚如何将坐标空间从谷歌地图转换为 api。有关土壤图的更多信息的网站在这里https://websoilsurvey.sc.egov.usda.gov/App/WebSoilSurvey.aspx

mapController.getScreenCoordinate(value).then((sc) {
    var x = sc.x;
    var y = sc.y;
    var t = ScreenCoordinate(
    x: x.toInt(),y: y.toInt());
    screenCoords.add(t);
});

谷歌地图的宽度/高度是 300/600。我将此值用于 mapimg_width、mapimg_height。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)