maps 0.1.2 copy "maps: ^0.1.2" to clipboard
maps: ^0.1.2 copied to clipboard

unlistedoutdated

A cross-platform geographic maps package. Supports Apple MapKit, Bing Maps, and Google Maps. Works in all platforms supported by Flutter, including browsers.

Pub Package Github Actions CI

Overview #

Geographic maps for Flutter applications.

This package is:

  • Cross-platform. Browser, Android, iOS, Windows, etc.
  • Multi-vendor. Supports all major map vendors (Apple, Bing, Google).

This is an early-stage version and lots of things are still missing or broken. Pull requests are welcome!

Getting started #

1.Add dependency #

dependencies:
  maps: ^0.1.2

2.Define configuration #

We recommend that you set a default MapAdapter in the main function of your application. This is more convenient than setting a MapAdapter for each widget separately.

Your main function should look something like this:

// ...
import 'package:maps/maps.dart';

void main() {
  MapAdapter.defaultInstance = const MapAdapter.platformSpecific(
    android: GoogleMapsNativeAdapter(apiKey:'GOOGLE MAPS API KEY'),
    browser: BingMapsIframeDapter(),
    ios: AppleMapsNativeAdapter(),
    otherwise: GoogleMapsStaticAdapter(apiKey:'GOOGLE MAPS API KEY'),
  );

  // ...

  runApp(MyApp());
}

3.Use #

MapWidget #

MapWidget is a Flutter widget that uses the map engine you chose:

// ...
import 'package:maps/maps.dart';

final widget = MapWidget(
  size: Size(300, 500),
  query: 'Paris',
  markers: [
    MapMarker(
      query: 'Eiffel Tower',
    ),
  ],
);

MapAppLauncher #

MapAppLauncher launches either:

  • A map website (such as Google Maps website)
  • A map application in the device (such as Google Maps for Android/iOS)
import 'package:maps/maps.dart';

Future<void> main() async {
  // Use default app
  await MapAppLauncher.defaultInstance.launch(query:'Eiffel Tower');

  // Use Google Maps
  await MapAppLauncher.googleMaps.launch(query:'Louvre Museum');
}

Supported map providers #

Apple Maps APIs #

iOS #

In ios/Runner/Info.plist, you should have something like:

	<key>io.flutter.embedded_views_preview</key>
	<true/>
	<key>Privacy - Location When In Use Usage Description</key>
	<string>A description of your privacy policy.</string>

Javascript #

Images #

Bing Maps APIs #

Javascript #

31
likes
0
pub points
50%
popularity

Publisher

verified publisherdint.dev

A cross-platform geographic maps package. Supports Apple MapKit, Bing Maps, and Google Maps. Works in all platforms supported by Flutter, including browsers.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

apple_maps_flutter, collection, cryptography, database, flutter, google_maps_flutter, js, meta, url_launcher, web_browser

More

Packages that depend on maps