google maps or wikimapia on mit app inventor 2

65 views
Skip to first unread message

salvatore d

unread,
Jul 31, 2018, 9:05:07 AM7/31/18
to MIT App Inventor Forum
hi,

function map on MAI2 is not defined....is possible insert google maps or wikimapia??

TK

SteveJG

unread,
Jul 31, 2018, 9:18:35 AM7/31/18
to mitappinv...@googlegroups.com
Your question is unclear ("function map on MAI2 is not defined.")    What does that mean Salvatore?   The instructions / documentation for the Map component are here :


The App Inventor 2 Map control uses OpenStreetMap tiles.   The control cannot use Google Map tiles or Wikimapia.  Map uses links to the OpenStreetMaps API.

If you want to use Google Maps, use the Google Static Maps API with the WebViewer.

There are numerous Forum discussions about how to use the Map component  and how to use Static Maps.

What exactly do you want to do?

Regards,
Steve

Chris Ward

unread,
Jul 31, 2018, 9:44:45 AM7/31/18
to MIT App Inventor Forum

salvatore d

unread,
Jul 31, 2018, 9:50:06 AM7/31/18
to MIT App Inventor Forum
Hi Steve,

I see that MAI2 use in fuction Maps>map the openstreetmap; for my location this map don't visualize terrain mode. Is possible insert google maps or wikimapia or use a part of these maps as background image???   TK?

salvatore d

unread,
Jul 31, 2018, 9:56:26 AM7/31/18
to MIT App Inventor Forum
i want to make an app of an archeological site that when i click on a building starts an explanation voice.

I have an image of the site but in not possible for me insert buttons in different position of image....or put buttons in different building.

is possible make that with function rectangle in map........but openstreetmap don,t have this site location

SteveJG

unread,
Jul 31, 2018, 10:47:10 AM7/31/18
to mitappinv...@googlegroups.com
No, adding a background image to the Map component is not possible.   

Terrain mode tiles are not available for all locations, that possibly is your issue.  Did you change the Map Property (in the Designer) from Roads to Terrain? That control works so if you do not see a Terrain map, one is not available for the area..  Google Map might have terrain tiles available in your area.  To use a Google Map with terrain, use the Google Map Static Map API using the WebViewer.   See https://developers.google.com/maps/documentation/maps-static/dev-guide for general guidelines to construct the required URL https://developers.google.com/maps/documentation/maps-static/dev-guide  .
  • maptype (optional) defines the type of map to construct. There are several possible maptype values, includingroadmapsatellitehybrid, and terrain. For more information, see Maps Static API Maptypes below.

You can also make your own map using different techniques.  .  What you need to do is complicated.  Look at the example here:


It uses a Canvas, a background image of a map in the Canvas  and some conversions routines to plot location point to approximate locations on the background map image.

Doing something like this might allow you to plot the archaeological site.   You would have to create 'hot spots' on the canvas to click on a building to elicit a TextToSpeech event or to play an mp3 file.

You cannot use the Rectangle control with Map to do this.


A very different strategy:    Provide the archaeological site map image on the background of a Canvas.   Use Canvas coordinates to locate sites using the Canvas x and y coordinates.    Provide a list of buildings/sites that points to the x y coordinates of the building/site.  Use an ImageSprite to place a marker on the building of interest and select buildings from a ListPicker or Listview.    

Another possibility is to use a MyMap map.   https://www.google.com/maps/about/mymaps/    Make a MyMap and link to it using the WebViewer.


Regards,
Steve

Luis Matheu

unread,
Jul 31, 2018, 3:53:51 PM7/31/18
to MIT App Inventor Forum
Hi I hope could be useful, but really I am just beginner
http://air.csail.mit.edu/punya/tutorials/

Best regard luisma

Reply all
Reply to author
Forward
0 new messages