maps 0.2.1 copy "maps: ^0.2.1" to clipboard
maps: ^0.2.1 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 #

Cross-platform geographic maps for Flutter applications.

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

Pull requests are welcome! The package is licensed under the Apache License 2.0.

Getting started #

1.Add dependency #

In pubspec.yaml:

dependencies:
  maps: ^0.2.1

Add the following in ios/Runner/Info.plist:

	<key>io.flutter.embedded_views_preview</key>
	<true/>

2.Use #

MapAppLauncher #

MapAppLauncher launches map applications.

The following implementations are available:

import 'package:maps/maps.dart';

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

MapWidget #

MapWidget shows a map:

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

void main() {
  runApp(const MaterialApp(
    home: Scaffold(
      body: MapWidget(
        size: Size(300, 500),
        camera: MapCamera(
          query: 'Paris',
        ),
        markers: [
          MapMarker(
            query: 'Eiffel Tower',
          ),
        ],
        adapter: MapAdapter.platformSpecific(
          ios: AppleNativeAdapter(),

          // Bing Maps iframe API does not necessarily require API credentials
          // so we use it in the example.
          otherwise: BingMapsIframeAdapter(),
        ),
      ),
    ),
  ));
}

Assuming that you have enabled Flutter for Web, you can run:

flutter run -d chrome

Supported map providers #

Apple Maps APIs #

iOS #

  • AppleMapsNativeAdapter enables you to use Apple MapKit. The current implementation depends on the Flutter package apple_maps_flutter, a package by a third-party developer.
  • The adapter doesn't require API credentials.
  • You need to edit ios/Runner/Info.plist (see "recommended configuration file changes").

Javascript #

Images #

Bing Maps APIs #

Javascript #

Iframes #

Images #

Google Maps APIs #

Android / iOS native SDK #

Use the separate package maps_adapter_google_maps.

Javascript #

Iframes #

Images #

Contributing? #

  • Pull requests are welcome.
  • Please test your changes manually using the "example" application in the repository.
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_flutter, database, flutter, js, meta, url_launcher, web_browser

More

Packages that depend on maps