Map Tour Always Goes to Wrong Location

Hi there,

I was having a little trouble with my project for AP Computer Science, and was wondering if anyone might know what's wrong with my code.

I have finished all of the steps and tutorials for the MIT App Inventor Map Tour, and have two additional features (Flyover: zooms out to wide view before zooming in to the next location, and Zoom Indicator: shows current zoom level, rounding to the nearest whole number to prevent long decimals.) Everything was working fine up until I added the custom locations button.

I added a destination in Salem, MA, but it never showed up on the destinations list. Now, any destination that I select from the list (New York Times Building, Washington Post Building, etc.) takes me to Salem. Since Salem never showed up on the list itself, I was not able to remove it after adding the deletion code.

I've tested it by adding and removing new destinations since then, but the latitude and longitude that the map zooms in on is always the same point in Salem, with no way that I could find to edit it.

I was wondering if anyone might have any information on how I could resolve this issue. Thank you in advance!

Your blocks image is unreadable.

(Canned Reply: ABG- Export & Upload .aia)
Export your .aia file and upload it here.
export_and_upload_aia

Chandler_MapTour_110923.aia (40.6 KB)

Thank you for your quick response! Here is the file! @ABG

Here's the blocks image per AI2, for those whose eyes are faster than mine:

I notice a presumptuous piece of code, prematurely storing one item of what should be updated in tandem:



The Add To List blocks should be together, in the Notifier After Text Input event, to avoid them getting out of sync.

I'm not sure yet if this is causing your problem, though.

First of all before testing again, connect with companion and clear tinyDB with Do it

Then make the following changes and see if it works for you

image

Got it!

Loading the same global from two different tags.

1 Like

Thank you for your help! I fixed the global LatLong section to say global Desinations.

For the part where you talk say "The Add To List blocks should be together, in the Notifier After Text Input event, to avoid them getting out of sync," should I use another procedure block to merge these duplicate code blocks, or is there another way to approach this?

Thank you again for your help!

Thank you for your help! When you discuss clearing the tinyDB, how exactly would this be done? I found the ClearAll bloc, but don't know where to implement it.

The second section was copied directly from the App Inventor tutorial on MobileCSP, and has worked well for others I know, so I left that section the same.

Thank you again for your help!

blocks (9)


@ABG Thank you for your help! Everything is now in working order!