Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Map app

115 views
Skip to first unread message

Payten Sainer

unread,
Oct 15, 2019, 10:54:53 AM10/15/19
to MIT App Inventor Forum
My classmate and I are working on a map of our high school and it will track your location and show you where you need to go. Is there a way to have a picture of the school map and put it onto a canvas, but have a marker showing where you are and have the map zoom in and out? 

SteveJG

unread,
Oct 15, 2019, 11:43:38 AM10/15/19
to MIT App Inventor Forum
Perhaps.   An answer to your query depends on exactly what you are trying to do Payten.  Yes, it is possible to have a 'picture' of a school map and place it on the background of a Canvas and use the map with a GPS/LocationSensor to know where you are.  Here is a complex way to do that.  The example uses a Canvas https://groups.google.com/forum/#!msg/mitappinventortest/JSAMiqATyx4/2--sTsz5AgAJ  .   The marker showing where you are would not be very accurate because you  translate latitude/longitude coordinates to the pixel coordinates on the Canvas.  It is a scaling issue.  Could you zoom in and out?   Not very practical but itcould be done with a lot of additional programming and additional image 'maps' ).

Instead, consider something like this:  Depending on your campus size, use the MIT Map component instead of a Canvas.  It is doubtful the map tiles would show the detail of your buildings, but it might.  If the map tiles do not display your campus buildings,  create a FeatureCollection to represent your school buildings.  You can 'draw' the buildings.   The feature collection would display your school map (but not an image of your map) on to the map tiles (an online tool at geoson.io  can help  you to do that).

Other methods are possible to use your picture and create hot spots that when clicked, could show approximately that spot on a Map (your app would have a Canvas map and a MIT component) and show your current location.


What you do depends on your school map and what you expect and how competent you are using the App Inventor tools and how long you have to build your Project.

Regards,
Steve

Payten Sainer

unread,
Oct 15, 2019, 12:49:38 PM10/15/19
to MIT App Inventor Forum
Thanks for the help! I'll check out the link. The only thing is that we need an inside map. Like of the hallways and rooms etc. Is that possible?

SteveJG

unread,
Oct 15, 2019, 2:02:15 PM10/15/19
to mitappinv...@googlegroups.com
Yes, a floor plan 'map' is possible using a picture map and a Canvas.   Are you aware your device's GPS might not work as you expect in an iron framed, multi-story building.  The gps receiver might not respond to position changes as someone walks inside.  Before you commit to this app, make sure your GPS has the ability to get a satellite fix when in a building.   This tutorial will explain why Using the Location Sensor .   Use the two sample app aia's to help you check.  When you read the article, especially read about the Property called Accuracy.  Working inside a building, the ability to resolve a location using the GPS is significantly degraded.  This means, the GPS does not know exactly where it is.  If you require precision interior locations, your idea might not work but try and see; what you get might be adequate.

If the GPS works everywhere inside the school, you could also use a FeatureCollection of the floor plan and use the Map component.

An app built like this will only track your location if the GPS works well inside and Accuracy for any satellite fix  is reported in low values.  Most Android devices only have the ability to resolve consistently within 30 meters of where the device thinks it is although occasionally it will resolve within almost two meters.   It is easy, using several methods to "show where you need to go" depending whether you use a Canvas or a Map.



You can describe a 'ring fence'  to tell your app user when they have arrived at their classroom.  To do a ring fence, you need the geocoordinates (latitude/longitude of a rectangular object that defines the classroom.     An example ringfence is show here    http://www.appinventor.org/bookChapters/chapter18.pdf          in the section Programming Complex Conditions or you can do it like this https://groups.google.com/forum/#!msg/mitappinventortest/BQ5H9PcAm5Y/owzIuunBEAAJ  




Payten Sainer

unread,
Oct 16, 2019, 12:06:24 PM10/16/19
to MIT App Inventor Forum
Thanks

TimAI2

unread,
Oct 16, 2019, 12:10:13 PM10/16/19
to MIT App Inventor Forum
If allowed, you could stick up QR Codes on the walls, which users could scan (with the app) to find their current location on the map

SteveJG

unread,
Oct 17, 2019, 4:04:34 PM10/17/19
to MIT App Inventor Forum
If you use a QR code that can be scanned to show a user's current position, then read the Canvas x,y coordinates directly from the QR code.  It would not be necessary to use a LocationSensor since you can post a Ball or ImageSprite directly to the Canvas x,y coordinates.  That would provide a marker tol show the  of the QR code  'location' on the 'map' image that is in the Canvas background.
Reply all
Reply to author
Forward
0 new messages