I can barely read any of the Blocks Jay.
Please post a clear image of your Blocks. Is the circled code supposed to post the current user's location in the Marker or what? Have you performed a DoIt debug on the LocationSensor.Latitude/Longitude. What values do they show? How to use DoIt by Ennis Knowing the values indicate whether you are getting GPS information. You might be showing 0,0 if you are not using the LocationChangedEvent or set TimeInterval to short or do not wait until your gps reports a satellite fix (and a LocatonChangedEvent).Glad to help but your images showing how you use the database are useless. Here is what I do know:
-
want to get the location of the user ---use the LocationSensor
-
find the three counties in the state of the user which have the most COVID-19 cases --you have to determine the state of the user using the coordinates from the LocationSensor then consult the database and search for the state
-
I want to display this information on a map. --- what information? the user's location Marker, the dots ? The code displays circles around those counties with the most COVID-19 cases in the particular state and when the circle is clicked, it displays the number of COVID-19 cases in that county. So, I imagine you want to post three circles and the Marker. -- ok, realize I can't see that or what it is supposed to look like.
-
Additionally, if the user is located in one of the three counties with the most COVID-19 cases in the state -- sorry, you cannot determine that with your present code. Your database probably provides the centroid coordinates of each county. The locationsensor will provide the actual user location. It is highly improbable that the two will ever be identical; it will never happen. To compare them the values for lat/lon must be identical.
-
the app sends a notification to the user. --Ok can't read your blocks so you might be alriight
-
My code works fine when I plug in an actual coordinate for the latitude and longitude --- really? Do you plug in the county centroid coordinates? Try any other coordinates that is within the county and your code will fail
-
but the location sensor doesn't seem to be able to pick up the pair by itself. -- sorry, I do not understand what pair it is supposed to pick up. It will NEVER have the exact coordinates of the centroid. You should be trying to establish, perhaps using a geojson of COUNTIES, whether the user is located in any of those counties. Your states geojson is large and has issues loading; the county geojson for the US is three to four times the states geojson. Will counties even load? I don't know.
-
The set Web1.url block links to a website which is an updated COVID-19 database with number of cases per county for each U.S state. Also, File 2 is a google sheet with longitude and latitude pairs for each county in the U.S. --- both of these are interesting ideas.
Very interesting idea. Part is working. Congratulations. I imagine the part not working includes establishing whether the user is located within one of the high covid plague counties. You cannot do that with the information you have available to you. Sorry. You can indicate the person is in the state and let him/her know graphically he/she is near one of the counties by showing the circles and the Marker on the map. You can also determine the distance from each circle to the user and tell that person how far they live from the counties with the highest plague counts. There is a block that calculates distance. You cannot equivocally tell that person a person is located in one of those troublesome counties without a county map outline.
Keep working on your app. Interesting ideas, difficult to implement. Parts do work so feel good and implement what is possible.
-- Steve