How do I import a .kml file in my App (to view them in OpenStreetMap as layers)?

I need to import .kml files to my app so as to view them in OpenStreetMap as layers. The problem is that i have upload the .kml files in Google Drive and in the App when i choose from the pallete "file" i can not upload my kml files.Can anyone help me with that;
Thanks in advance!

Maybe this will help How to import, create and use gpx and kml track files using App Inventor Map Part II Use SAF extension to select kml/gpx files stored in your Documents folder

Thanks for your interest but this solution does not work for me !

what about following the tutorial?

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Well for this project i am searching for a solution to import .kml files that already exist in my Google Drive and not to make blocks with buttons to import .kml file as shown in the previous tutorials that you send me!

Download file and then import. I see no problem there.

App inventor does not have a native way to directly use kml files with OpenStreetMap tiles. Why not try this tutorial (already mentioned by Taifun) or use SAF? you can not merely copy kml/gpx files into the Documents folder and expect them to be usable with the the compiled app . Usable files must be created with the compiled app.

This is what is available at the moment. If you want to do this another way you might have to write your own extension to use your kml file. This is primarily because Google security restricts how an app can use files that the app itself did not create.

See KML - OpenStreetMap Wiki the section KML data into OSM.

Alright i will check it ! May i ask you if you know any other way to import shapefile data to my OSM in the app;

Perhaps Shp2osm - OpenStreetMap Wiki . However this would not be compatible with the Map component. You would have to use (if it would work at all) usingthe OSM api instead of Map to display the map.

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