hi, i want to retrieve my latitude and longitude data from mysql database. i have convert them into json format. i want it to display as a marker in a map. this is my block
as i know you have did the same thing as what i am trying to do. you catching the latitude and longitude from the mysql database. can you provide me more information regarding the steps please?
Your pairs should be like this :
[
{ lat: 37.772, lng: -122.214 },
{ lat: 21.291, lng: -157.821 },
{ lat: -18.142, lng: 178.431 },
{ lat: -27.467, lng: 153.027 },
]
In my case I returned a Json where the lat and long pairs existed and I assembled a string as shown above.
Because the longitudes and latitudes are in a table in my database. In this table I have this latitude and longitude information for each person registered. So on the return Json, I took these pairs and assembled the pairs to show the markers.
This json I mount after searching mysql and put it in the block:
You can use the dictionary or :
Take a list and put the return of the Json TextDecode block in it. This block receives its response content.
YourList < JsonDecode Text > Response Content
Once that’s done, take a For each item in YourList and use the lookup pairs in Key block (the key will be latitude and longitude) and use Add IItens to List Block to assemble new list;
use Join with “{lat: ,lng: }”