simple_tiles_map 2.1.1 copy "simple_tiles_map: ^2.1.1" to clipboard
simple_tiles_map: ^2.1.1 copied to clipboard

Crea fondos de mapa de OpenStreetMap, google, Stamen, CartoMap, Esri de forma sencilla.

Simple Tiles Map #

Capturas #

Cómo utilizar? #

Ejemplo de uso básico

import 'package:flutter/material.dart';
import 'package:simple_tiles_map/simple_tiles_map.dart';
void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    LatLng? mapCenter = const LatLng(-16.480954, -68.189594);
    MapOptions mapOptions = MapOptions(
      initialCenter: mapCenter,
      maxZoom: 19,
      minZoom: 5,
    );
    return MaterialApp(
      title: 'Tiles Basemap',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Mapa Base ${TypeMap.stamenWater}'),
        ),
        body: Column(
          children: [
            SimpleTilesMap(
              typeMap: TypeMap.stamenWater,
              mapOptions: mapOptions,
              isOffline: false, mapController: MapController(),
            ),
          ],
        ),
      ),
    );
  }
}


Ejemplo insertando un Marker

import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:latlong2/latlong.dart';
import 'package:simple_tiles_map/simple_tiles_map.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    Marker myMarker = Marker(
      width: 80.0,
      height: 80.0,
      point: LatLng(-16.480954, -68.189594),
      builder: (ctx) => const Icon(
        Icons.add_location_alt,
        color: Colors.red,
        size: 50,
      ),
    );
    return MaterialApp(
      title: 'Tiles Basemap',
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Set Marker on Map'),
        ),
        body: Column(
          children: [
            SimpleTilesMap(
              typeMap: TypeMap.osmHot,
              isOffline: false,
              otherLayers: [
                MarkerLayer(
                  markers: [
                    myMarker,
                  ],
                )
              ],
            ),
          ],
        ),
      ),
    );
  }
}

9
likes
140
points
122
downloads

Publisher

unverified uploader

Weekly Downloads

Crea fondos de mapa de OpenStreetMap, google, Stamen, CartoMap, Esri de forma sencilla.

Homepage
Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_map, flutter_map_tile_caching, isar, isar_flutter_libs, latlong2, path_provider

More

Packages that depend on simple_tiles_map