Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A Flutter package to provide the native maps to Android/iOS

License

NotificationsYou must be signed in to change notification settings

fluttercommunity/platform_maps_flutter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Flutter package that provides a native map to both Android and iOS devices.

The plugin relies on Flutter's mechanism for embedding Android and iOS views. As that mechanism is currently in a developers preview, this plugin should also be considered a developers preview.

This package combines thegoogle_maps_flutter plugin withapple_maps_flutter to create a cross platform implementation of native maps for Android/iOS.

Screenshots

AndroidiOS
Example 1Example 2
Example 1Example 2

Current functionality

  • Camera movement including bearing, heading, tilt (also animated)
  • Markers, including custom marker images and Info windows
  • Different map types
  • Map manipulation, enable/disable gestures, show current location, show compass ...

iOS

You will have to add the keyPrivacy - Location When In Use Usage Description with the value of your usage description.

Android

Specify your API key in the application manifest android/app/src/main/AndroidManifest.xml:

<manifest ...  <application ...    <meta-dataandroid:name="com.google.android.geo.API_KEY"android:value="YOUR KEY HERE"/>

Sample Usage

classHomePageextendsStatelessWidget {@overrideWidgetbuild(BuildContext context) {returnScaffold(      body:PlatformMap(        initialCameraPosition:CameraPosition(          target:constLatLng(47.6,8.8796),          zoom:16.0,        ),        markers:Set<Marker>.of(          [Marker(              markerId:MarkerId('marker_1'),              position:LatLng(47.6,8.8796),              consumeTapEvents:true,              infoWindow:InfoWindow(                title:'PlatformMarker',                snippet:"Hi I'm a Platform Marker",              ),              onTap: () {print("Marker tapped");              },            ),          ],        ),        myLocationEnabled:true,        myLocationButtonEnabled:true,        onTap: (location)=>print('onTap: $location'),        onCameraMove: (cameraUpdate)=>print('onCameraMove: $cameraUpdate'),        compassEnabled:true,        onMapCreated: (controller) {Future.delayed(Duration(seconds:2)).then(            (_) {              controller.animateCamera(CameraUpdate.newCameraPosition(constCameraPosition(                    bearing:270.0,                    target:LatLng(51.5160895,-0.1294527),                    tilt:30.0,                    zoom:18,                  ),                ),              );            },          );        },      ),    );  }}

Suggestions and PR's to make this plugin better are always welcome. Please notice that the features provided by this package depend on the apple_maps_flutter plugin, which will improve in the future.

About

A Flutter package to provide the native maps to Android/iOS

Topics

Resources

License

Stars

Watchers

Forks

Contributors9

Languages


[8]ページ先頭

©2009-2025 Movatter.jp