How can we get a geojson string from map component?

Is there any way I can get the geojson string from map. Currently only way is to save the string in storage & then access it from there. It would be better if I can directly get the content of GEOJSON string so that i can use it further without needing the storage permissions from user.

@ewpatton @Susan_Lane

@ewpatton Or maybe Have i missed something in the docs?

  1. Stop tagging people
  2. Directly get the content of the geoJson, how, where, with what ? Do you mean on the same device in a different app?

Sorry for tagging.
I mean can we get GEOJSON as a string using the map component (instead of storing it in the device). On the same device same app.

Of course. Use the file component to read the saved map file.


But won't it seem to user that the app is asking for file permissions (when there is nothing related to files in my app). I know it can be done this way but still I just thought a simple block for getting the text would be more useful.

I think storing it in apps scope storage wont require storage permissions haven't tried yet but I read about it online.

There are no file permissions issues if you simply provide a file name. The geoJson file will be stored either in your ASD or in your /storage/emulated/0 folder, depending on your Android version. You may need to request WRITE_EXTERNAL_STORAGE permission for Android API < 29 when the app is compiled.

1 Like

What you are saving after you press #1 then #2 is in the Label1

for an example using the default Map coordinates, two arbitrary Design time Markers and an arbitrary Polygon using this code


Now the fun (not really fun) begins as you attempt to extract the json pieces from the FeatureCollection you just captured. :cry:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.