Add a map that shows different places already added

I want to add to my app a map that shows all the clean points in a certain city, but I can’t find any information about how to do it. Please if anyone could help I would really appreciate it.
Thanks

'clean' points????

Perhaps you want to do something like Map Tour

or Use Map Markers using the MIT Map component. You can hard code the coordinates of the Markers or populate the Markers from a List or csv file. Here is an example by Tim using the MIT Map component that uses OpenStreetMap tiles and a GoogleSpreadsheet. You can avoid the spreadsheet by coding individual Markers using the Marker design time model or using a csv file embedded in your app containing the marker coordinates as I describe here

Explain more about what you want to do Agatha and someone could perhaps provide more specific advice.

What have you tried?

Regards,
Steve

I want to do an app that shows where you can throw the rubbish,like in the recycling centers. Do i need to create a background API, because I have no idea how to create one.
I haven’t tried anything yet cause I don’t know where to start or how to do it.

There are several ways to approach this problem Agatha…

  • Use an intent. The ActivityStarter allows developers to use intents with App Inventor 2.

To create a map of recycling centers you could use this code

The code searches Google Maps for recycling center and returns a map of recycling centers using Google Maps (if Google provides a listing of the businesses that do that kind of thing in your area… it might not) using the Google Maps app on your device.

You have to test this approach on a real Android device. The AS approach does not work on an emulator.

If you don’t like the results when you search using recycle center; try dump, clean points or trash pickup (just substitute for the recycle center words in the code block).

Here is how to search a specific city (in this case, London, England) You must enter the geocoordinates for London (sorry, this does not work simply by entering London,England).

  • Use a user provided List of geocoordinates of the locations of the ‘centers’ .
    Post these locations on an OpenStreetMap map tile using a Map Marker. Something like this:


    might be what you want to do.

  • A third way would use a LocationSensor to provide more specific information. That code is more complex and not posted.

You now know two ways to create a map showing recycling centers. You can start coding something Agatha. Let us know what happens. Does this answer your question?

Here are some resources to help you learn to use the AI2 tools. A very good way to learn App Inventor is to read the free Inventor’s Manual here in the AI2 free online eBook http://www.appinventor.org/book2 … the links are at the bottom of the Web page. The book ‘teaches’ users how to program with AI2 blocks.

There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro and the aia files for the projects in the book are here: http://www.appinventor.org/bookFiles

How to do a lot of basic things with App Inventor are described here: http://www.appinventor.org/content/howDoYou/eventHandling .

Also look here http://kio4.com/appinventor/index.htm and here http://www.imagnity.com/tutorial-index/ for more tutorials.

– Steve

1 Like

Thank you so so much. I’ll try to follow the guide you sent me and I’ll see how it goes.

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