Skip to content

Flutter Map plugin for ArcGIS Esri. Currently support feature layer (point, polygon)

License

Notifications You must be signed in to change notification settings

CSEKINGS/flutter_map_arcgis

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flutter Map plugin for ArcGIS Esri

Currently support feature layer(point, polygon, polyline coming soon)

We are working on more features

A Dart implementation of Esri Leaflet for Flutter apps. This is a plugin for flutter_map package

Usage

Add flutter_map, dio and flutter_map_arcgis to your pubspec:

dependencies:
  flutter_map: any
  flutter_map_arcgis: any # or the latest version on Pub
  dio: any # or the latest version on Pub

Add it in you FlutterMap and configure it using FeatureLayerOptions.

  Widget build(BuildContext context) {
      return MaterialApp(
        home: Scaffold(
          appBar: AppBar(title: Text('ArcGIS')),
          body: Padding(
            padding: EdgeInsets.all(8.0),
            child: Column(
              children: [
                Flexible(
                  child: FlutterMap(
                    options: MapOptions(
                      center: LatLng(32.91081899999999, -92.734876),
                      zoom: 11.0,
                      plugins: [EsriPlugin()],
  
                    ),
                    layers: [
                      TileLayerOptions(
                        urlTemplate:
                        'http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}',
                        subdomains: ['mt0', 'mt1', 'mt2', 'mt3'],
                        tileProvider: CachedNetworkTileProvider(),
                      ),
                      FeatureLayerOptions(
                        url: "https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/USA_Congressional_Districts/FeatureServer/0",
                        geometryType:"polygon",
                        onTap: (attributes, LatLng location) {
                          print(attributes);
                        },
                        render: (dynamic attributes){
                          // You can render by attribute
                          return PolygonOptions(
                              borderColor: Colors.blueAccent,
                              color: Colors.black12,
                              borderStrokeWidth: 2
                          );
                        },
  
                      ),
                      FeatureLayerOptions(
                        url: "https://services8.arcgis.com/1p2fLWyjYVpl96Ty/arcgis/rest/services/Forest_Service_Recreation_Opportunities/FeatureServer/0",
                        geometryType:"point",
                        render:(dynamic attributes){
                          // You can render by attribute
                          return Marker(
                            width: 30.0,
                            height: 30.0,
                            builder: (ctx) => Icon(Icons.pin_drop),
                          );
                        },
                        onTap: (attributes, LatLng location) {
                          print(attributes);
                        },
                      ),
  
                    ],
                  ),
                ),
              ],
            ),
          ),
        ),
      );
    }

Run the example

See the example/ folder for a working example app.

About

Flutter Map plugin for ArcGIS Esri. Currently support feature layer (point, polygon)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 84.2%
  • Ruby 7.0%
  • Kotlin 3.6%
  • Swift 2.9%
  • Objective-C 2.3%