google_static_maps_controller 0.5.0 copy "google_static_maps_controller: ^0.5.0" to clipboard
google_static_maps_controller: ^0.5.0 copied to clipboard

outdated

The package provides simple and declarative access to the Google Static Maps service.

google_static_maps_controller #

Codemagic build status

The package provides simple and declarative access to the Google Static Maps service.

Feature Status
Base Static map support
Zoom levels
Image sizes
Map types
Markers
Map styles
Paths
Encoded Polylines
Viewports ⚙️

✅ - done
🧪 - experimental
⚙️ - work in progress
❌ - not yet implemented

Example: #

map_screenshot

Getting Started #

StaticMap widget: #

// ***

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        /// Declare your static map
        child: StaticMap(
          width: 400,
          height: 400,
          scaleToDevicePixelRatio: true,
          googleApiKey: "<GOOGLE_API_KEY>",
          /// Declare optional markers
          markers: <Marker>[
            /// Define marker style
            Marker(
              color: Colors.lightBlue,
              label: "A",
              locations: [
                /// Provide locations for markers of a defined style
                Location(-3.1178833, -60.0029284),
                Location(-3.1467579, -59.8753814),
              ],
            ),
            /// Define another marker style with custom icon
            Marker.custom(
              anchor: MarkerAnchor.bottom,
              icon: "https://goo.gl/1oTJ9Y",
              locations: [
                Location(-3.1694166, -60.1041517),
              ],
            )
          ],
        ),
      ),
    );
  }

// ***

StaticMapController #

  Widget build(BuildContext context) {
    /// Declare static map controller
     const _controller = StaticMapController(
      googleApiKey: "<GOOGLE_API_KEY>",
      width: 400,
      height: 400,
      zoom: 10,
      center: Location(-3.1178833, -60.0029284),
    );

    /// Get map image provider from controller.
    /// You can also get image url by accessing
    /// `_controller.url` property.
    ImageProvider image = _controller.image;

    return Scaffold(
      body: Center(
        /// Display as a normal network image
        child: Image(image: image),
      ),
    );
  }
51
likes
0
pub points
94%
popularity

Publisher

verified publisherklyta.it

The package provides simple and declarative access to the Google Static Maps service.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on google_static_maps_controller