Flutter 未应用颤振iOS贴图样式
我想在我的颤振图中隐藏地图上的所有地标和其他指示器。我已经为google地图包(google_maps_Flatter)实现了地图样式。这种风格在Android上表现得很好,但在iOS上却没有。映射没有引发任何错误消息或异常。我希望能深入了解原因。我有最新版本的插件1.0.3。下面是我的风格和颤振博士的输出 颤振式Flutter 未应用颤振iOS贴图样式,flutter,google-maps,dart,flutter-dependencies,Flutter,Google Maps,Dart,Flutter Dependencies,我想在我的颤振图中隐藏地图上的所有地标和其他指示器。我已经为google地图包(google_maps_Flatter)实现了地图样式。这种风格在Android上表现得很好,但在iOS上却没有。映射没有引发任何错误消息或异常。我希望能深入了解原因。我有最新版本的插件1.0.3。下面是我的风格和颤振博士的输出 颤振式 [ { "featureType": "administrative", "elementType":
[
{
"featureType": "administrative",
"elementType": "geometry",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "poi",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "road",
"elementType": "labels.icon",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "transit",
"stylers": [
{
"visibility": "off"
}
]
}
]
这是我的医生
[✓] Flutter (Channel stable, 1.22.0, on Mac OS X 10.15.6 19G2021, locale en-ZA)
• Flutter version 1.22.0 at /Users/danemackier/flutter
• Framework revision d408d302e2 (4 weeks ago), 2020-09-29 11:49:17 -0700
• Engine revision 5babba6c4d
• Dart version 2.10.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/danemackier/Library/Android/sdk
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.0.1, Build version 12A7300
• CocoaPods version 1.9.1
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 44.0.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] VS Code (version 1.50.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.15.1
[✓] Connected device (1 available)
• iPhone 11 Pro Max (mobile) • 400921E6-429C-44D7-B113-F979A171C48A • ios •
com.apple.CoreSimulator.SimRuntime.iOS-14-0 (simulator)
• No issues found!
如果您试图获取没有地标符号的地图:
String _mapStyle
GoogleMapController controller;
然后在初始化状态下:
@override
void initState() {
rootBundle.loadString('assets/map_style.txt').then((string) {
_mapStyle = string;
});
super.initState();
}
void _onMapCreated(GoogleMapController controller) {
this.controller = controller;
controller.setMapStyle(_mapStyle);
}
onmacreated被分配给参数onmacreated中的GoogleMap小部件我完全按照您在这里提到的做了。此处显示的样式来自于使用该样式。我要升级我所有的颤振版本。我仍然使用1.22.0,因此它可能有助于升级、清理和运行新版本。我以后会试试的,不。还没有,我在git上也有一个问题需要解决。