Hi All,
I want to implement a map with polygon reading form a GeoJson or KML files.
I have followed the documentation in OutsystemsUI but not able to view the polygons in the file. Can anyone help me with what i am doing wrong?
Steps I followed:
1 - Google maps api with Key2- Map component in the screen 3- File Layer on the screen 4- Geojson or KML file in Resources with Deploy to target location 5- Create an expose api with file content in resources 6- copy the Url of the api in the documentation7- paste the url in File layers layer url property
Thanks
Hi @Abhinava Reddy Muddamreddy
This is what I get when opening the oml you attached:
Either way, I just confirmed that the File Layer add-on does not support GeoJSON files, and the documentation is incorrect. The add-on supports only KML and GeoRSS data formats. The documentation will be fixed in the next release to avoid further confusion.
To use the GeoJSON format, the customer must add a client action to the Map_Initialized event and create a JS Node with the code below (replacing the URL).
const map = OutSystems.Maps.MapAPI.MapManager.GetMapById($parameters.MapId).provider; map.data.loadGeoJson("https://storage.googleapis.com/mapsdevsite/json/google.json");
You can also use these documents as references:
Cheers,GM
Hello @Abhinava Reddy Muddamreddy
Could you please share with the community what you have tried so far (by sharing a sample oml) and where you are having your struggles, so any help the community can provide can be more targeted and avoid spending time that's not needed for lack of information being shared?
Hi GM,
I have followed the Outsystems UI Maps steps on how to use File layer addon. I have also attached an oml as well.
If we have any other way to integrate shapefiles in maps as well and any direction is appreciated.
ThanksAbhinav
Hello,When I tried to use the code, map was undefined. Because there is no Outsystems.Maps.
So to load the geoJson the script was:
const map = MapAPI.MapManager.GetMapById($parameters.MapId).provider;
Thanks.