Hi can any one help me for creating location that stored in firebase , I have lat ,long and name stored in firebase and wat to show it own maps
This test is definitely wrong.
Maybe you wanted to test the tag instead of the value?
If the value was just a piece of text, it would fail all the subsequent dictionary lookups in value.
Either way, show us the data content from the Firebase data console, so we can see its tree structure and content.
{
"masjids": {
"masjid1": {
"asr": "04:30 PM",
"fajr": "05:00 AM",
"isha": "08:00 PM",
"latitude": 28.557738476760615,
"longitude": 77.41150478421909,
"maghrib": "06:45 PM",
"name": "Jama Masjid",
"zuhr": "01:00 PM"
},
"masjid2": {
"asr": "04:30 PM",
"fajr": "05:00 AM",
"isha": "08:00 PM",
"latitude": 28.6505,
"longitude": 77.2334,
"maghrib": "06:45 PM",
"name": "Noor Masjid",
"zuhr": "01:00 PM"
}
}
}
this is my firebase data
(``` added for clarity - ABG)
can you help me in block
thanks for block , do i need to add marker in map as you have add green block of marker .
also set marker has only pluggable option
You need at least one Marker in the Map to get the blocks.
Right click on the block you want to generalize and choose Make Generic, or pull one in from the Any Marker block pallet
masjid.aia (7.1 KB)
i have done exactly you mentioned but still no new marker is creating only marker i placed on map is sowing i have attached project
You placed ONE design time Marker on the Map. If you want to post all the locations in your Firebase database and display them, you will either need to use run time Markers or place as many design time Markers as you will need in your Project. You would need to hide the markers you are not using except as you require more coordinates from Firebase.
Either possibility is more complex than the code you have already coded.
The tutorial below shows one way a developer can use runtime markers. There is code there that you could adapt.
I added a debug screen to show markers and relocate the map to the points in your Firebase data.
Sample run (my colors for markers)
masjid (1).aia (10.9 KB)
Important Do It results:
What I did in the debug screen to get the markers and to show them:
- Notice that the Firebase bucket was set to 'masjids', so that tag would never be accessible. We are past that tag. So the Firebase Get should be against the empty tag, to get everything under the current bucket.
- added a global variable to hold the return value, for debugging. Confirmed in a Do It against that global variable that we got a dictionary of dictionaries.
- got rid of that tag test, since we are already there.
- Started local lists of lats and longs from the incoming data, to help get the midpoint of the map for panning. Used the average (mean) math block to pan the Map.
- added all the diagnostic features of the map (zoom) to help locate the markers. We were too far zoomed in(13), so zooming out to 10 showed the markers.
- Changed the map zoom to 10 in the Designer. There is a Bounding box block for the map that looks like it could be useful to show all the markers, but I did not play with it.
- Hid the Marker1 in the Designer, so it would not show on the map, but we would still have blocks for Markers
- Added a Screen Initialize event calling for everything under our Firebase bucket (using empty tag)
it done now,I just wanted to say a heartfelt thank you for all the help and support you've given me.
It bothered me to have to hard wire a Map zoom level 10 in the Designer to show all the markers, so I wrote a BoundingBox procedure to show all the markers with a proportional margin on all sides, for context.
The map BoundingBox attribute covers both the Pan and Zoom .
Here's a sample, and the code:
Margin = 1
masjid.aia (12.1 KB)
Draggable procedure:
now i add click marker which call notifier having goto button to redirect it to google maps but it s not popping up on clicking i have diabled enable info box , Iplace it sepearatly do i need to place in marker loop
Perhaps you need a comma ( , ) between get global selectedLat and get global selecteddLon in the activitystarter1.DataUri ? Add a comma and let us know if that works?
See
You need a generic event that will apply to any marker.
I got this one by right clicking on that Marker1 event block and choosing "make generic".
Ignore the red errors, I did not bother pulling in the referenced global variable init blocks.
P.S. Also do the @SteveJG comma thing.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.