How to visualize the shp files in Flutter Maps?
In Syncfusion® Flutter Maps, you can visualize the shp file after converting it to a GeoJSON file. To do that, a shape package with shp and dbf files are required for the conversion.
Step 1: Go to https://mapshaper.org/
Step 2: Drop the shape package files in the dropdown box. A new dialog box is shown on screen. Click the Import button.
Step 3: Now the uploaded shape can be seen on the screen. Tap on the Export button on the top right corner. A menu for export is shown. Tap the GeoJSON radio button and press Export.
Step 4: Add and refer this downloaded JSON file in the Flutter application as mentioned in this link.
The above mentioned website is used for demo purpose only. We kindly request you to check the licensing terms and conditions before using it.
late MapShapeSource _mapSource; @override void initState() { _mapSource = MapShapeSource.asset( 'assets/australia.json', shapeDataField: 'STATE_NAME', ); super.initState(); } @override Widget build(BuildContext context) { return Scaffold( body: SfMaps( layers: [ MapShapeLayer( source: _mapSource, ), ], ), ); }
Screenshot
Check the below links for more features in shape layer.
- https://www.syncfusion.com/flutter-widgets/flutter-maps
- https://help.syncfusion.com/flutter/maps/overview#shape-layer
- https://pub.dev/packages/syncfusion_flutter_maps
Live samples,
- https://flutter.syncfusion.com/#/maps/shape-layer/range-color-mapping
- https://play.google.com/store/apps/details?id=com.syncfusion.flutter.examples
- https://apps.apple.com/us/app/syncfusion-flutter-ui-widgets/id1475231341
Conclusion
I hope you enjoyed learning about how to visualize the shp files in Flutter Maps.
You can refer to our Flutter Maps
feature tour
page to know about its
other groundbreaking feature representations documentation and
how to quickly get started for configuration
specifications. You can also explore our Flutter
Maps example
to understand how to
create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!