Skip to first unread message

Sagar

unread,
Jun 15, 2015, 7:40:28 AM6/15/15
to mitappinv...@googlegroups.com
Hi Guys,

I am trying to build a simple app which would get Geolocation of phone (showing accuracy of GPS) and could open kmz files (multiple/one over another) from SD Card and can orient the map with North and Direction of Movement, with MIT AI2.

Any help would be highly appreciated. Thanks 

Taifun

unread,
Jun 15, 2015, 11:51:41 AM6/15/15
to mitappinv...@googlegroups.com
an example, which displays some coordinates from a kml file you can find here https://puravidaapps.com/geolocation.php
Taifun

Sagar

unread,
Jun 16, 2015, 3:36:34 AM6/16/15
to mitappinv...@googlegroups.com
Hi Taifun,

Thanks for a quick reply.
I visited the link you provided, it uses webviewer. However, I am looking for something which would read the kml/kmz from SD Card and display it on the map canvas along with geolocation.

SteveJG

unread,
Jun 16, 2015, 8:21:54 AM6/16/15
to mitappinv...@googlegroups.com
Taifun's suggestion is the best 'simple' solution Sagar.   The only other solution is to use the Google Location API along with a Google Static Map.

Look here https://developers.google.com/maps/documentation/staticmaps/    and find the heating Path.  This solution does not use an actual kml file.

Another solution is to load a kml file into a Fusion Table and use the FT Mapping capability.  That will not allow you to display it on a map canvas.

What you can do with plotting points on a Canvas has a lot to do with what your kml file is supposed to do (plot points, plot a path etc.)  See the tutorials here    regarding Maps   https://appinventorforfun.wordpress.com/       ... there are three tutorials that may be of interest to you, specifically possibly Maps 101 and 102.  If you can use a csv file instead of a kml file as input, those solutions will possibly work in your project.

You may need to use Eclipse or Android Studio to program what you want,  Both Java compilers have access to the full Google mapping library with native components; App Inventor does not.



Regards,
Steve

Sagar

unread,
Jun 16, 2015, 8:46:13 AM6/16/15
to mitappinv...@googlegroups.com
Hi Steve,

Thanks for a prompt reply.

Actually, I shouldnot have written "Navigator", which is making the things complicated I guess.
What is required is a simple "Viewer" for KML/KMZ file with the present geolocation (Google Maps on background are also not required)

I went through the tutorials you mentioned but they use web to access google static maps, which is why they have to go online.

I will rewrite the problem statement: (as earlier one I did not write properly)
 
a) Browse KML file from SD Card (and open)
b) See the KML with Geolocation (no background map needed) (although another KML/KMZ overlay may be added to the canvas)

SteveJG

unread,
Jun 16, 2015, 9:42:39 AM6/16/15
to mitappinv...@googlegroups.com
You still are not clear to me.    
Perhaps:

a)  You can read a kml file as a text file using the File component and display the kml in a label.

b) well this is complicated because your kml coordinates are in World values and the Canvas coordinates are in Screen coordinates.   You have to write a transform from World coordinates to screen coordinates to post the kml points (if that is what your file shows) into screen coordinates.   Here is a partial example of a transform  https://groups.google.com/forum/#!searchin/mitappinventortest/world$20to$20screen/mitappinventortest/nbYsAAzFRMo/Q0UVi4LkJpIJ   (not exactly what you need).

You talk about kml overlays etc.  If you want to play with all these, you would be better served with Eclipse or Android Studio, the Java compilers that have a full mapping library.

Can it be done.  Yes. The transform and scaling complicated.   You got to do is transform something like     30, -90    geocoordinates to   y and x screen coordinates.  Latitude should be represented on the y axis of the Canvas and  longitude on the x axis. Youdo that for each point in the kml and post the points associated with each location.  Some of the concepts discussed in 

Canvas Graph…an expert AI2 tutorial   apply although that tutorial does not show how to post geocoordinates on a Canvas that you scale.


Regards,
Steve
Reply all
Reply to author
Forward
0 new messages