How to represent GeoJson Lines

Hello.


I am using SFMap to represent GeoJson Data.
I have managed to render the polygons well, but have read in a similar post that the lines are not supported yet.

Is there a way to render lines from the GeoJson format in SyncFusion Map?
Can you give me an example on flutter?

Thanks in advance !!!

3 Replies

MS Mohamed Samsudeen K S Syncfusion Team January 15, 2021 12:52 PM UTC

Hi Ray,

 

Could you please confirm whether you are trying to add lines to the shapes? If it is the requirement, please check about our MapLineLayer in the below link.

 

https://help.syncfusion.com/flutter/maps/vector-layers/line-layer#adding-lines

 

If your requirement is different, we kindly request you to provide more details about it. It will be helpful for us to provide the most appropriate solution.

 

Regards,

Samsudeen



RC Ray Cast Sant January 15, 2021 01:12 PM UTC

Hi Mohamed, thanks for replying.
Yes, my requirement is different.
I need to set the source of the data from a GeoJson file, similar to this:

dataSource = MapShapeSource.asset (
      'assets / australia.json',
    );

But in my case, the features type in my GeoJson file is LineString.

I appreciate any help, Thanks


LR Lakshmi Radha Krishnan Syncfusion Team January 18, 2021 12:10 PM UTC

Hi Ray,

 

Thanks for the update.

 

Currently, we do not have direct support for loading the data of LineString type from the JSON file. We will check whether we can consider this as a new feature request to our SfMaps widget.

 

However, if your requirement is to achieve an UI similar to the below image, we will check whether we can achieve this using a workaround with the current APIs itself.



https://help.syncfusion.com/flutter/maps/vector-layers/polyline-layer#adding-polylines


Could you please confirm whether you are trying to add the lines as a sublayer on top of another shape layer as shown in the above image? If not, we kindly request you to provide more details or an example image of it.

 

Regards,

Lakshmi R.

Loader.
Up arrow icon