Extracting and displaying GPS coordinates


Greetings All,

I am working on a project as seen in the mockup;

1)where the app would receive SMS from an Arduino

2)and then the app displays the SMS on the label

3)extracts the GPS coordinates

5)displays the coordinates in the map

as seen in the block image.

Thank you for the support

You can do this. You need to learn how to do multiple things.

You cannot do it like smsGPS

1)where the app would receive SMS from an Arduino
Your Arduino is sending that Text message? If so the Arduino ‘knows’ what the coordinates are so the Arduino could just send the coordinates to your app and display it in the Label using BlueTooth. For some reason you want to send an SMS using the Arduino. Yes, your Arduino probably can send a text message. When the text arrives, parse the message and extract the latitude and longitude.

Once you get that far, ask again about

2)and then the app displays the SMS on the label

3)extracts the GPS coordinates

5)displays the coordinates in the map.

Sure, it can display the coordinates once you know them. You can do this several ways. Do you know how to use the MIT Map component?

Sure,thank you.
The map component, not really.

Place a Map component on your screen.
Add a design time Map Marker on the Map (it doesn’t matter where)
Create the code for Button3

Set the Map Height and Width to Fill parent (the default is Automatic)

run the simple app

This technique places a Map Marker at the indicated latitude and longitude.

You can code and run it in five minutes. :slight_smile:

thank you, will try it out.

when you try with the coordinates you posted, you should see
something like this
lookFamiliar
depending on the zoom value you enter (this display uses a zoom of 10).

sure,that’s what i got.Thanks

thanks for the good job.
is it possible to zoom a map in this APP like normally on the phone?

yes. If you use the Map component, you can change the zoom level of the map by pinching or double-tapping to zoom. You can also use the ShowZoom.true to show zoom controls .

What you can do with the Map control is described in Map

1 Like

Great thank you.
Is it possible to show hiking route on an offline phone map, what's the handle of map and how to keep the route ?

the online google map used:
Gsm.print("Google Maps");
Gsm.print("Latitude = ");
Gsm.print(" Longitude = ");

If you save your route to a LineString and save the Points to a TinyDB or CloudDB or FirebaseDB or Googlesheet you can reproduce the route on a map using the Map component.

An example LineString to draw a track - #8

If you want to do this on a Google Map, Google Map tiles, rather than OSM map tiles you would use the Google Map API.

1 Like

Thank you SteveJG.
I downloaded a map from a hiking web link below, that can independently work in cell phone, is it ok to send GPS data to that map?
MAPS.ME (MapsWithMe), detailed offline maps of the world for iPhone, iPad, Android

I do not know. It appears you download a map file using that app. The offline map seems to be a map on an OpenStreetMap tile base, perhaps in kml format. Do you have the kml file? I seem to recall the that it is possible to extract the hiking map trail to a LineString. If that is true, then the following applies and you might be able to post some of the data from that map to the Map component:

You can convert kml to json or json to kml. How? Here is a beginning https://groups.google.com/forum/#!category-topic/mitappinventortest/app-inventor-extensions/DqEeorciOC0 These links provide some other potential ideas.

https://www.google.com/search?q=kml+to+json&oq=kml+to+json&aqs=chrome..69i57.4175j0j7&sourceid=chrome&ie=UTF-8

Is this possible? What you do depends on why you need the coordinate information in kml format. https://developers.google.com/kml/documentation/kml_tut and why you need to work with Google Earth. KML traks can be displayed (with some transformation) on the Map component as a LineString.

A location in kml format looks like
kml

Is this what you need to know?

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