首页 > 解决方案 > 如何从东到西,从南到北显示整个谷歌地图的经纬度?

问题描述

我正在使用谷歌地图颤振插件将此代码(obj-c)翻译成颤振。

if(self.useMap.isOn)
{
    CGSize sz = self.mapView.frame.size;
    CLLocationCoordinate2D ptl = [self.mapView convertPoint:CGPointMake(0, 0) toCoordinateFromView:self.mapView];
    CLLocationCoordinate2D pbr = [self.mapView convertPoint:CGPointMake(sz.width, sz.height) toCoordinateFromView:self.mapView];

    [param setFloat:ptl.latitude forKey:@"lat1"];
    [param setFloat:ptl.longitude forKey:@"lng1"];
    [param setFloat:pbr.latitude forKey:@"lat2"];
    [param setFloat:pbr.longitude forKey:@"lng2"];
}

我正在尝试从屏幕上显示的谷歌地图中获取两组 lat 和 lng。

标签: objective-cfluttergoogle-maps-flutter

解决方案


推荐阅读