Skip to main content

siro_gl 1.0.0-beta.1 copy "siro_gl: ^1.0.0-beta.1" to clipboard
siro_gl: ^1.0.0-beta.1 copied to clipboard

Native MapLibre maps for Flutter: Mapbox Vector Tile (MVT) and PMTiles sources, custom styles, GeoJSON layers and offline regions on Android, iOS and Web.

example/lib/main.dart

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

void main() {
  runApp(const _ExampleApp());
}

class _ExampleApp extends StatelessWidget {
  const _ExampleApp();

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      home: _ExampleHomePage(),
    );
  }
}

class _ExampleHomePage extends StatefulWidget {
  const _ExampleHomePage();

  @override
  State<_ExampleHomePage> createState() => _ExampleHomePageState();
}

class _ExampleHomePageState extends State<_ExampleHomePage> {
  SiroMapController? _controller;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('maplibre_gl minimal example')),
      body: SiroMap(
        styleString: 'https://demotiles.maplibre.org/style.json',
        onMapCreated: (c) => _controller = c,
        initialCameraPosition: const CameraPosition(
          target: LatLng(0, 0),
          zoom: 1.0,
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () async {
          final c = _controller;
          if (c == null) return;
          await c.animateCamera(
            CameraUpdate.newCameraPosition(
              const CameraPosition(target: LatLng(0, 0), zoom: 3),
            ),
          );
        },
        child: const Icon(Icons.flight),
      ),
    );
  }
}
0
likes
155
points
74
downloads
screenshot

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

Native MapLibre maps for Flutter: Mapbox Vector Tile (MVT) and PMTiles sources, custom styles, GeoJSON layers and offline regions on Android, iOS and Web.

Repository (GitHub)
View/report issues

Topics

#map #maplibre #vector-tiles #openstreetmap #gis

Funding

Consider supporting this project:

github.com
opencollective.com

License

BSD-3-Clause (license)

Dependencies

collection, flutter, siro_gl_platform_interface, siro_gl_web

More

Packages that depend on siro_gl

Packages that implement siro_gl