Help with National Parks Tutorial

I am struggling to run this app it keeps saying something about: The operation > cannot accept the arguments: , [0.0], [empty-string]. I think the problem is with the Sort and get list procedure. Any ideas how to fix this will be appreciated?

after clicking plot parks the app shows markers but gets no further...
No hidden buttons becomes visible.

Thanks for your posts Waldo.

It appears the latest version of Companion 2.63 or the nb189a release on June 19, 2022 broke the code again. :cry:
I will attempt to find out what the problem is. Yes I get a similar error .

Use the fixed aia. replacement Waldo.

NationalParks3a.aia (17.0 KB).

The aia was corrected in the tutorial too. National Park Tutorial (Markers) updated

The problem was how the new release handled the csvdistanceList differently than pre update.

Does the example work now?

1 Like

Hi, so I need help on getting explanation for these super long block codes on why and what does it do.

The blocks are as below

  1. The whole block is very confusing, but why is it needed and what does it do?

  1. What is the purpose of the minimum value needed for?
  2. Why does the selected item, needs to be sorted out?

  1. There are a couple distance lists, may i know what are the difference between them and the functions?
  2. What does the control "for each number from 1 to length of list by 1" do
  3. if the number in marker map list is less than 1 then it will add item in it, is my interpretation correct?
  4. Why does global csv has to be joined with the decimal number of user's lat and long?
  5. Why does experimental distance CSV has to be converted into the distance csv
  6. Then, why will experimental distance CSV be deleted

  1. I don't understand why is minimum at the index and what does it do

Thank you so much for helping out, I really want to understand the codes, so that i can start doing a similar project for my own use.

The aia is here
NationalParks3a.aia (17.0 KB)

Credits to @SteveJG

The Procedure sorts a generic List. See List Sorting On App Inventor | imagnity . The Procedure is used in the app to determine the Park that is closest (by straight line distance) to the app's user. The app needs to determine how far away each Park is from the app's user. If you are not concerned with which Park is closest, the MinimumValueinList would not be needed. You might wish to re-read the tutorial

The "for each number... "
does several things, notably the involved Block calculates the distance each Park is from the user.

Load and run the aia, then use DoIt debugger to see what values are evaluated in specific parts of the code.

Bon soir
Je m'intéresse au mit app inventor et votre app
Je comprend pas à quoi sert le fichier scv
J'ai installé l'application avec des amis mais il y a just un seul marker apparue au lieu du 10
L'application utilisée pour randonnée
Merci de vos aides

The purpose of the csv file (comma separated file) is to tell the app what location Markers to plot.

The example plots

Name of Park, fictitious phone number, latitude, longitude

Shenandoah N.P.,1111111111,35.7647,-82.2653
Yosemite N.P.,1111111111,37.8651,-119.5383
Sequoi N.P.,1111111111,36.4864,-110.5885
El Capitan N.P.,1111111111,37.7339,-119.6377
Acadia N.P.,1111111111,44.33897,-68.27343
Mesa Verde N.P.,1111111111,37.23087,-108.46184
Yellowstone N.P.,1111111111,44.4279,-110.58838
Zion N.P.,1111111111,37.31721,-113.02254
Haleakala N.P.,1111111111,20.70128,-156.17312
Petrified Forest N.P.,1111111111,34.90999,-109.80679
Glacier N.P.,1111111111,48.75961,-113.78702
Grand Canyon N.P.,1111111111,36.10696,-112.11299
Rocky Mountain N.P.,1111111111,40.34279,-105.68364
Carlsbad Caverns N.P.,1111111111,32.14785,-104.55671
Olympic N.P. ,1111111111,47.96907,-123.49825
Bryce Canyon N.P.,1111111111,37.59304,-112.18709
Cuyahoga Valley,1111111111,41.28082,-81.56781
Mt. Rainier N.P.,1111111111,46.87886,-121.72691
...and more

The csv provides the coordinates telling the app where to place a map Marker.

You do not see this?

. Probably only see the little man on your location? Zoom out the map to show North America; you should now see many locations. The markers are all locations in the USA (except for your location) :astonished:

Yes, you could use this as a basis for showing good hiking locations.

Did this answer your questions?


Hhh oui j'ai minimiser la carte j'ai compris merci de votre aide donc je vais ajenctionné cette application avec l'application social distancing
Pour le partage de possible des autre randonneurs mais le nombre des randonneurs est différent à chaque sortie
J'ai pas besoin de nom ou distance sauf le markeur pour la sécurité ou cas où
Es ce que il y a possibilité d'ajouter plusieurs marqueurs en cas Il y a beaucoup de randonneursou il faut programmer des code pour chaque personne

You do not explain how your hiking app will work @Kadour_Aissa . Because I do not know your intentions, it difficult to respond to your questions. Are you just trying to keep track of a number of hikers or share everyone's location. What is your app supposed to do?

add this application with the social distancing application for the possible sharing of other hikers

Yes, it is possible to merge the features of National Park Tutorial (Markers) updated with the features of the social distancing tutorial. If it is your intention to share locations, the Social Distancing ... a CloudDB / Location Marker Tutorial might be a better example as it uses a shareable database. What you do depends on what your app is supposed to do.

number of hikers is different on each outing

Do not confuse Run time Markers with Design time Markers. This example uses Run time Markers; it spawns additional markers as needed depending on the number of locations in your csv file. Handle the number of hikers by using Run time Markers or using hidden Design time markers. If the number of hikers is not large, I would use only Design time Markers and make them visible or hidden depending on requirements.

I don't need name or distance except marker for security

Only include the features you require in your app. The tutorial has features that are not appropriate for everyone's app. An ID associated with each Marker is useful but not necessary.

Is it possible to add several markers in case there are a lot of hikers or it is necessary to program codes for each person

The National Park app uses Run time Markers. Run time Markers are difficult to code for various reasons. It is often better and easier to provide more Design time Markers than your app needs instead of using Run time Markers. Hide the Design time Markers in the app you are building until you have to have another (Marker1.Visible = false to hide; = true to display).

marqueurs de temps de conception ça me convient
Malgré que je ne sais même pas quel est la différence entre le marker de conception et d'exécution
Masquez les marqueurs de conception dans l'application et quand un nouveau randonneur utilise l'application un nouveau marker s'affiche sur la carte
Donc il faut refaire toutes l'application distanciation sociale
Si vous pouvez me donner example comment masquer un marker de conception et 'affiche automatiquement quand un nouveau randonneur utilise l'app
Au passé j'ai voulez ajouter du code pour chaque randonneur comme mom dad ...etc
Et vous m'avez donné une idée simple et je sais pas comment la codé
Merci encore de votre temps