FeatureCollection of POINTS not showing up as MARKERS on the map

I'm loading a FeatureCollection from a URL ( http://www.marininfo.org/test/FetureCollection3.json ) and it successfully fires GOTFEATURES.!
But no MARKERS appear on the map.

The same FeatureCollection, pasted into https://geojson.io/#map=20/37.96239/-122.55812 , successfully produces MARKERS.

FeatuireCollection_from_URL_Test.aia (115.4 KB)


I tried it like this -- but still no markers.

I imagine this is what you expect


However, at the moment either App Inventor or OpenStreetMaps server is glitching or because
of all this 'stuff'

.alscotch2

that you do not need , or your index.html. I can't tell you more. Yuk.

Success! I used your url with this code successfully. Really, that is all the code you need unless you want to add your design time Marker coordinates. I am not sure, but I do not think you can add the information for the Marker bubbles using this. Let me think about that.


Sometimes the fluff gets in the way. :slight_smile:

Thanks a lot ! Interesting !
Those extensions were removed.
This is what I had. !

I removed the index.html and re-saved -- its exactly the same size 116kb

Here it is again
FeatuireCollection_from_URL_Test.aia
(115.1 KB)

I tried your block but kept the GOTFEATURES and it made no difference.

And now I cant get ANY AP to connect with the QR Code ( Error 1103 "Unable to post or put text "key=......)
Never had this problem before.

Meanwhile --I went into X-plore in the Android and deleted all the EXTensions in APPINVENTOR/ASSETS/EXTERNAL_COMPS
Settings FORCE STOP MIT AppInventor Companion

I started with a NEW Ap and recreated to what you have.
But still getting Error 1103 for this and any other AP. Even after restarting MITAppinventor in the browser.
To be continued .........

This describes 1103
https://groups.google.com/g/mitappinventortest/c/pBvrDFODsog

The extensions in your original aia were still resident in the build made from the aia you provided.

The only way I could get your FeatureCollection to run properly is
aScotch.aia (2.3 KB) made as a new Project.
It runs again and again and again without issue on my Android Tablet.:slight_smile:

Please try it. There is some additional code in the aia. A start in my attempt to provide Marker Titles in a Bubble. Unfortunately that cannot be done automatically...no Title or Description property in the geojson.

Why impossible?

The FeatureCollection can capture
description becomes Description
draggable becomes Draggable
infobox becomes EnableInfobox
fill becomes FillColor
fill-opacity becomes FillOpacity
image becomes ImageAsset
stroke becomes StrokeColor
stroke-opacity becomes StrokeOpacity
stroke-width becomes StrokeWidth
title becomes Title
visible becomes Visible

The geojson does not contain any of those Properties. For example, the FeatureCollection properties downloaded are not congruent with what the component can render ( "properties": {"osm_id": 547597956, "osm_type": 2, "distance": 0.0, "category_ids": {"601": {"category_name": "parking", "category_group": "transport"}}, "osm_tags": {"null": null}}}, ) .You have to provide your own labels. One way to do that is to provide a List of the Marker component 'names'; which I started. That can be used with a List of the Title or Description and linked as a List of pairs with a List of the Titles.

I started to provide an example showing how one could provide their own Title/Description, but did not get far.

[quote="Al_Scotch, post:4, topic:16096"]
Error 1103
[/quote] I expect one of these may be the problem: alscotch2 . Elements of the script of one or more of these
third party may still be lingering. You are still using the index.html... you do not need it. Get rid of it and see what happens.

Have a great evening.

Thanks again for all this GREAT help !
I powered off my modem/router and repowered it and the 1103 went away.

And now I get your one-block-script to work. ( markers appear ! )

Now looking at aScotch.aia. -- and it works too.

I have to surmise that deleting all the Extension stuff in folder APPINVENTOR/ASSETS/EXTERNAL_COMPS fixed it , maybe?
Cant think of anything else that changed .

The markers on https://geojson.io/#map=20/37.96239/-122.55812 can be clicked and a scrollable infobox pops up with at least a couple of useful things "name" and "category_name" .
Although the json does not contain info like "marker color" -- their AP defaults to grey ( like AppInventor's red) It would be nice if AppInventor defaulted to provide that infobox popup on click.

I wonder what AppInventor expects in the json for Infobox? And what info would then appear in AppInventor if "Infobox" is enabled?

Anyway I read the rest of your reply and I'm afraid I don't understand it .
It seems that its related to how you use the "FeatureFromDescription" block which is still a mystery to me and I have no idea what to plug it into. Its input(called "description") has to be a list !?! I plugged a one item list ( containing "title") into it and gota java error.
--- java.lang.String cannot be cast to com.google.appinventor.components.runtime.util.YailList

This


shows in Notifier that same text that you are putting in screen title.( it all of a sudden accepts a string!)

Can I fix anything by renaming the contents of the json where every "name" is replaced by "title" ( or "description") for instance?
and then what ?

And can you please tell me what the CreateMarker block plugs into ? ( and then what?)

Congratulations. You are making progress.

Nice but not possible. A developer can enable and populate the InfoBox with code. See attached.

. How that is done depends on the information available in the geojson you work with.

Maybe. Did you try it? How to work with the modified geojson would be complex but it should be possible.

I and Evan already did that, didn't we? Where are you supposed to plug in the featurefromdescription block? - #2 by SteveJG and Where are you supposed to plug in the featurefromdescription block? - #3 by ewpatton . What you do to 'plug-in' depends on what you expect to achieve; create a series of run time Markers or a single run time Marker. Why do you want to use the CreateMarker Block? Whether a developer uses a design time Marker (for example Marker1) or uses a run time Marker (using the CreateMarker) depends on the purpose. Design time Markers are simple to use; run time Markers are more complex. Each type of Marker has advantages. Look at my example or do the National Parks tutorial or use the you can connect to the input of the evaluate but ignore result Block. Try those methods on a stand alone Project.

Thanks again for your help .
At this point I give up.

What extension are you using to produce the "set Marker" block ?
Its kinda not intuitive that the "component" input to that is an item in a FeatureCollection list -- but it looks relatively useful when combined with runtime markers getting created from FeatureCollection.

And OMG ! I just found an example usage of "CreateMarker" Block -- and you create a marker by just plugging the block into a list ?!!! What? Where did that crazy concept come from ?
No wonder I couldn't figure out how to use it.

and for sure the block "FeatureFromDescription" is unusable.
Thanks anyway,
Alan

PS I replaced with "title" and "description" to produce http://www.marininfo.org/test/FetureCollection4.json

Hi Alan. The Map components are the most complex of all the AI tool. You can do all these things * Map components

No extension. The Set Marker.... blocks are the Any component Blocks

No, that does not create the Marker; it assigns a name to it so the developer can access it. Do you want to avoid the 'crazy concept'? Do not use the CreateMarker at all; you probably do not need it. Usually a developer can live with the simpler to understand design time Markers where you just drag and drop the Marker to the designer and set the parameters using the Properties or Blocks..

Here are some resources to help you learn to use the AI2 tools. You need to forget a lot you may have learned with traditional programming languages. 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

To program using App Inventor, you need to learn how to do a lot of basic things with App Inventor are described here: http://www.appinventor.org/content/howDoYou/eventHandling .

Also look here App inventor español. Offline. Tutorial. Ejemplos. Instalación. Códigos. Juegos. Curso gratis de App inventor. and here Tutorial Index | imagnity for more tutorials.

Learn about components Component Reference

and visit the Library The MIT App Inventor Library: Documentation & Support Help>Library on the MENU