someone please help me do this:
Add a new marker when the user adds a destination to the list and have the Text-To-Speech component speak the Marker titles when clicked.
this image is the code relating to this, there more with the other stuff but not important for my problem
this is the aia file MapTourComplete.aia (5.9 KB)
your app uses Design time Markers so you cannot add any more Markers with code and expect them to display on the map. Use Run time Markers (using the
) to 'create' additional markers
or add more Design time Markers than you expect to ever use. Set the inactive Design time markers to Marker4.VIsible = false until you need them.
your present code does 'add' more Marker coordinates to your List but you never assign the coordinates to a Design time marker so the new locations cannot display at present. Because you haven't assigned a marker to the coordinates your TextToSpeech will not work for the added locations because it depends on a marker existing.
You can try these Blocks with the example aia you posted.
The additional Blockks will add Runtime Markers . However the Markers are not persistent, you have to add your own code to 'save' these 'added' locations for the next use of the app. I did not attempt that.
Regarding the NationalParks Tutorial; add the following code to the tutorial and pressing the location marker will 'speak'
Yes, that is all you need to do with a Run time marker.
ok, thanks so much!!! it works but I get this error message after I input the name for my marker locations but the text-to-speech still works after that
i still need to figure out the tiny db, it saves the location in my global destinations variable and in my list picker but not the physical marker on the map
Glad the Run time and TextToSpeech code suggested are working.
You are coding on an ios device. App Inventor for ios is still VERY buggy.
Perhaps this discussion applies TinyDB-problem with iOS with respect for ios Projects and TinyDB use.
Do be aware, your markers stored in the TinyDB doesn't have any associated code to load the 'saved location information on Screen1.Initialize to your markers List , saving markers alone is not going to accomplish this. Saving and reloading Runtime markers has to be done using additional code to re-initialize run time markers using the CreateMarker block. Perhaps use the methodology shown in the NationalPark Tutorial. I think you should be save the Marker data stored as a csv and use that csv to repopulate markers or something like that. I can only guess.