{"id":13806089,"url":"https://github.com/marchdev-tk/flutter_google_maps","last_synced_at":"2025-04-15T01:35:07.533Z","repository":{"id":47132844,"uuid":"244397651","full_name":"marchdev-tk/flutter_google_maps","owner":"marchdev-tk","description":"A Flutter plugin for integrating Google Maps in iOS, Android and Web applications. It is a wrapper of google_maps_flutter for Mobile and google_maps for Web.","archived":false,"fork":false,"pushed_at":"2021-10-14T00:28:49.000Z","size":205,"stargazers_count":88,"open_issues_count":40,"forks_count":57,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-06T03:08:01.064Z","etag":null,"topics":["dart","dart2","dartlang","flutter","flutter-package","flutter-plugin","google-maps","map","mobile","web"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marchdev-tk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-02T14:54:50.000Z","updated_at":"2024-06-19T06:31:18.000Z","dependencies_parsed_at":"2022-08-18T21:52:01.917Z","dependency_job_id":null,"html_url":"https://github.com/marchdev-tk/flutter_google_maps","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marchdev-tk%2Fflutter_google_maps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marchdev-tk%2Fflutter_google_maps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marchdev-tk%2Fflutter_google_maps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marchdev-tk%2Fflutter_google_maps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marchdev-tk","download_url":"https://codeload.github.com/marchdev-tk/flutter_google_maps/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248989672,"owners_count":21194634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","dart2","dartlang","flutter","flutter-package","flutter-plugin","google-maps","map","mobile","web"],"created_at":"2024-08-04T01:01:07.726Z","updated_at":"2025-04-15T01:35:07.505Z","avatar_url":"https://github.com/marchdev-tk.png","language":"Dart","readme":"# flutter_google_maps\n\n![Build](https://github.com/marchdev-tk/flutter_google_maps/workflows/build/badge.svg)\n[![Pub](https://img.shields.io/pub/v/flutter_google_maps.svg)](https://pub.dartlang.org/packages/flutter_google_maps)\n![GitHub](https://img.shields.io/github/license/marchdev-tk/flutter_google_maps)\n![GitHub stars](https://img.shields.io/github/stars/marchdev-tk/flutter_google_maps?style=social)\n\nA Flutter plugin for integrating Google Maps in iOS, Android and Web applications. It is a wrapper of google_maps_flutter for Mobile and google_maps for Web.\n\n## Getting Started\n\n* Get an API key at \u003chttps://cloud.google.com/maps-platform/\u003e.\n\n* Enable Google Map SDK for each platform.\n  * Go to [Google Developers Console](https://console.cloud.google.com/).\n  * Choose the project that you want to enable Google Maps on.\n  * Select the navigation menu and then select \"Google Maps\".\n  * Select \"APIs\" under the Google Maps menu.\n  * To enable Google Maps for Android, select \"Maps SDK for Android\" in the \"Additional APIs\" section, then select \"ENABLE\".\n  * To enable Google Maps for iOS, select \"Maps SDK for iOS\" in the \"Additional APIs\" section, then select \"ENABLE\".\n  * Make sure the APIs you enabled are under the \"Enabled APIs\" section.\n\n* You can also find detailed steps to get start with Google Maps Platform [here](https://developers.google.com/maps/gmp-get-started).\n\n### Web\n\n```html\n\u003cbody\u003e\n  \u003cscript src=\"https://maps.googleapis.com/maps/api/js?key=API_KEY\"\u003e\u003c/script\u003e\n  \u003cscript src=\"main.dart.js\" type=\"application/javascript\"\u003e\u003c/script\u003e\n\u003c/body\u003e\n```\n\n### Android\n\nSpecify your API key in the application manifest `android/app/src/main/AndroidManifest.xml`:\n\n```xml\n\u003cmanifest ...\n  \u003capplication ...\n    \u003cmeta-data android:name=\"com.google.android.geo.API_KEY\"\n               android:value=\"YOUR KEY HERE\"/\u003e\n```\n\n### iOS\n\nSpecify your API key in the application delegate `ios/Runner/AppDelegate.m`:\n\n```objectivec\n#include \"AppDelegate.h\"\n#include \"GeneratedPluginRegistrant.h\"\n#import \"GoogleMaps/GoogleMaps.h\"\n\n@implementation AppDelegate\n\n- (BOOL)application:(UIApplication *)application\n    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\n  [GMSServices provideAPIKey:@\"YOUR KEY HERE\"];\n  [GeneratedPluginRegistrant registerWithRegistry:self];\n  return [super application:application didFinishLaunchingWithOptions:launchOptions];\n}\n@end\n```\n\nOr in your swift code, specify your API key in the application delegate `ios/Runner/AppDelegate.swift`:\n\n```swift\nimport UIKit\nimport Flutter\nimport GoogleMaps\n\n@UIApplicationMain\n@objc class AppDelegate: FlutterAppDelegate {\n  override func application(\n    _ application: UIApplication,\n    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?\n  ) -\u003e Bool {\n    GMSServices.provideAPIKey(\"YOUR KEY HERE\")\n    GeneratedPluginRegistrant.register(with: self)\n    return super.application(application, didFinishLaunchingWithOptions: launchOptions)\n  }\n}\n```\nOpt-in to the embedded views preview by adding a boolean property to the app's `Info.plist` file\nwith the key `io.flutter.embedded_views_preview` and the value `YES`.\n\n#### Android/iOS Directions API\n\nAdd in your `main.dart` within `main` function `GoogleMap.init('API_KEY');` before running the app.\n\n```dart\nvoid main() {\n  GoogleMap.init('API_KEY');\n  WidgetsFlutterBinding.ensureInitialized();\n  runApp(MyApp());\n}\n```\n\nFor more info about **mobile** map setup, view [google_maps_flutter](https://pub.dev/packages/google_maps_flutter) plugin.\n\n### Add GoogleMap Widget\n\n```dart\nimport 'package:flutter/material.dart';\nimport 'package:flutter_google_maps/flutter_google_maps.dart';\n\n...\nGlobalKey\u003cGoogleMapStateBase\u003e _key = GlobalKey\u003cGoogleMapStateBase\u003e();\n\n@override\nWidget build(BuildContext context) =\u003e GoogleMap(\n  key: _key,\n),\n...\n```\n\nAnd now you're ready to go.\n\n## Examples\n\n### GoogleMap widget can be configured with:\n\n| Property          | Type                   | Description                                                                      |\n| :---------------: | :--------------------: | :------------------------------------------------------------------------------: |\n| initialPosition   | GeoCoord               | The initial position of the map's camera                                         |\n| initialZoom       | double                 | The initial zoom of the map's camera                                             |\n| mapType           | MapType                | Type of map tiles to be rendered                                                 |\n| minZoom           | double                 | The preferred minimum zoom level or null, if unbounded from below                |\n| maxZoom           | double                 | The preferred maximum zoom level or null, if unbounded from above                |\n| mapStyle          | String                 | Sets the styling of the base map                                                 |\n| mobilePreferences | MobileMapPreferences   | Set of mobile map preferences                                                    |\n| webPreferences    | WebMapPreferences      | Set of web map preferences                                                       |\n| interactive       | bool                   | Defines whether map is interactive or not                                        |\n| onTap             | ValueChanged\u003cGeoCoord\u003e | Called every time a GoogleMap is tapped                                          |\n| onLongPress       | ValueChanged\u003cGeoCoord\u003e | Called every time a GoogleMap is long pressed (for web when right mouse clicked) |\n| markers           | Set\u003cMarker\u003e            | Markers to be placed on the map                                                  |\n\n**`MapType` is one of following variants:**\n\n  * `none` -\u003e do not display map tiles\n  * `roadmap` -\u003e normal tiles (traffic and labels, subtle terrain information)\n  * `satellite` -\u003e satellite imaging tiles (aerial photos)\n  * `terrain` -\u003e terrain tiles (indicates type and height of terrain)\n  * `hybrid` -\u003e hybrid tiles (satellite images with some labels/overlays)\n\n**`MobileMapPreferences` can be configured with:**\n\n| Property                 | Type       | Description                                                                        |\n| :----------------------: | :--------: | :--------------------------------------------------------------------------------: |\n| compassEnabled           | bool       | True if the map should show a compass when rotated                                 |\n| mapToolbarEnabled        | bool       | True if the map should show a toolbar when you interact with the map. Android only |\n| myLocationEnabled        | bool       | True if a \"My Location\" layer should be shown on the map                           |\n| myLocationButtonEnabled  | bool       | Enables or disables the my-location button                                         |\n| indoorViewEnabled        | bool       | Enables or disables the indoor view from the map                                   |\n| trafficEnabled           | bool       | Enables or disables the traffic layer of the map                                   |\n| buildingsEnabled         | bool       | Enables or disables showing 3D buildings where available                           |\n| padding                  | EdgeInsets | Padding to be set on mapdetails                                                    |\n| rotateGesturesEnabled    | bool       | True if the map view should respond to rotate gestures                             |\n| scrollGesturesEnabled    | bool       | True if the map view should respond to scroll gestures                             |\n| zoomGesturesEnabled      | bool       | True if the map view should respond to zoom gestures                               |\n| tiltGesturesEnabled      | bool       | True if the map view should respond to tilt gestures                               |\n\n**`WebMapPreferences` can be configured with:**\n\n| Property           | Type | Description                               |\n| :----------------: | :--: | :---------------------------------------: |\n| streetViewControl  | bool | Enables or disables streetViewControl     |\n| fullscreenControl  | bool | Enables or disables fullscreenControl     |\n| mapTypeControl     | bool | Enables or disables mapTypeControl        |\n| scrollwheel        | bool | Enables or disables scrollwheel           |\n| panControl         | bool | Enables or disables panControl            |\n| overviewMapControl | bool | Enables or disables overviewMapControl    |\n| rotateControl      | bool | Enables or disables rotateControl         |\n| scaleControl       | bool | Enables or disables scaleControl          |\n| zoomControl        | bool | Enables or disables zoomControl           |\n| dragGestures       | bool | Enables or disables flutter drag gestures |\n\n### To prepare for interacting with GoogleMap you will need to:\n\nCreate a `key` and assign it to the `GoogleMap` widget.\n\n### GoogleMap widget has 2 static methods, they are:\n  \n* MapOperations of(GlobalKey\u003cGoogleMapStateBase\u003e key);\n  \n  Gets [MapOperations] interface via provided `key` of [GoogleMapStateBase] state.\n\n\n* void init(String apiKey);\n  \n  Initializer of [GoogleMap]. `Required` if `Directions API` will be needed. For other cases, could be ignored.\n\n\n### To interact with GoogleMap you'll need to:\n\n**Use static `of` method**\n\nHere's list of interactions:\n\n* Move camera to the new bounds\n  ```dart\n  void moveCameraBounds(\n    GeoCoordBounds newBounds, {\n    double padding = 0,\n    bool animated = true,\n    bool waitUntilReady = true,\n  });\n  ```\n\n* Move camera to the new coordinates\n  ```dart\n  void moveCamera(\n    GeoCoord latLng, {\n    bool animated = true,\n    bool waitUntilReady = true,\n    double zoom,\n  });\n  ```\n\n* Zoom camera\n  ```dart\n  void zoomCamera(\n    double zoom, {\n    bool animated = true,\n    bool waitUntilReady = true,\n  });\n  ```\n\n* Get center coordinates of the map\n  ```dart\n  FutureOr\u003cGeoCoord\u003e get center;\n  ```\n\n* Change Map Style.\n\n  The style string can be generated using [map style tool](https://mapstyle.withgoogle.com/).\n  Also, refer [iOS](https://developers.google.com/maps/documentation/ios-sdk/style-reference)\n  and [Android](https://developers.google.com/maps/documentation/android-sdk/style-reference)\n  style reference for more information regarding the supported styles.\n\n  ```dart\n  void changeMapStyle(String mapStyle);\n  ```\n\n* Add marker to the map by given [position]\n  ```dart\n  void addMarkerRaw(\n    GeoCoord position, {\n    String label,\n    String icon,\n    String info,\n    ValueChanged\u003cString\u003e onTap,\n    VOidCallback onInfoWindowTap,\n  });\n  ```\n**Please note:** [icon] could be a *path to an image asset* or it could be an instance of *ByteString*.\n\n* Add marker to the map by given [marker] object\n  ```dart\n  void addMarker(Marker marker);\n  ```\n\n* Remove marker from the map by given [position]\n  ```dart\n  void removeMarker(GeoCoord position);\n  ```\n\n* Remove all markers from the map\n  ```dart\n  void clearMarkers();\n  ```\n\n* Add direction to the map by given [origin] and [destination] coordinates\n  ```dart\n  void addDirection(\n    dynamic origin,\n    dynamic destination, {\n    String startLabel,\n    String startIcon,\n    String startInfo,\n    String endLabel,\n    String endIcon,\n    String endInfo,\n  });\n  ```\n\n* Remove direction from the map by given [origin] and [destination] coordinates\n  ```dart\n  void removeDirection(dynamic origin, dynamic destination);\n  ```\n\n* Remove all directions from the map\n  ```dart\n  void clearDirections();\n  ```\n\n* Add polygon to the map by given [id] and [points]\n  ```dart\n  void addPolygon(\n    String id,\n    Iterable\u003cGeoCoord\u003e points, {\n    ValueChanged\u003cString\u003e onTap,\n    Color strokeColor = const Color(0x000000),\n    double strokeOpacity = 0.8,\n    double strokeWidth = 1,\n    Color fillColor = const Color(0x000000),\n    double fillOpacity = 0.35,\n  });\n  ```\n\n* Edit polygon on the map by given [id] and [points]\n  ```dart\n  void editPolygon(\n    String id,\n    Iterable\u003cGeoCoord\u003e points, {\n    ValueChanged\u003cString\u003e onTap,\n    Color strokeColor = const Color(0x000000),\n    double strokeOpacity = 0.8,\n    double strokeWeight = 1,\n    Color fillColor = const Color(0x000000),\n    double fillOpacity = 0.35,\n  });\n  ```\n\n* Remove polygon from the map by given [id].\n  ```dart\n  void removePolygon(String id);\n  ```\n\n* Remove all polygones from the map.\n  ```dart\n  void clearPolygons();\n  ```\n\n## Feature requests and Bug reports\n\nFeel free to post a feature requests or report a bug [here](https://github.com/marchdev-tk/flutter_google_maps/issues).\n\n## TODO\n\n* Add circles support\n* Add polyline support\n","funding_links":[],"categories":["Dart"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarchdev-tk%2Fflutter_google_maps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarchdev-tk%2Fflutter_google_maps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarchdev-tk%2Fflutter_google_maps/lists"}