Articles in this section
Category / Section

How to visualize the shp files in Flutter Maps?

1 min read

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.

 

Note:

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

Map

Description automatically generated

 

Check the below links for more features in shape layer.

 

Live samples,

 

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 forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied