Hi dear communitiy,
What I want:
A screen with a catalogue of Adresses in a dataverse table. All entries in the catalogue should show up on the map as markers.
The table has longitude and latitude columns.
What I tried:
- Creating a collection colLocations with ClearCollect in OnStart and setting the MapControl.Items to the collection colLocations.
- Setting MapControl.Items to ForAll(TableName; { latitude: ThisRecord.Latitude;
})
- reading the official documentation
- watching Youtube videos for 3 hours (extremely frustrating since most stuff isn't up to date anymore)
How do I do that?
HI @CD00131
There are a few additional fields that you need to configure so the map can show you the correct locations.
So if you already have the Items property configure with the collection, then lets configure the other ones.
ItemsLabels this is the text you want to show along with the pin in the map, for example here im displaying city name, just put collection field name in quotes for example "City" or "Location"
ItemsLatitude just put your columns Latitud name "Latitude" Don't remove the quotes
Same for ItemsLongitude just put "Longitude" Don't remove the quotes
PD: for you guidance my collection looks like this
ClearCollect(
colLocations,
{
Name: "Location 1",
Latitude: 37.7749,
Longitude: -122.4194,
Description: "San Francisco, CA"
},
{
Name: "Location 2",
Latitude: 34.0522,
Longitude: -118.2437,
Description: "Los Angeles, CA"
},
{
Name: "Location 3",
Latitude: 40.7128,
Longitude: -74.0060,
Description: "New York, NY"
}
);
And thats it now your map should be working 😁
If my response resolved your issue, please feel free to mark it as the solution by clicking "Accept as solution." This helps others find the answer more easily. If you found the content helpful in any other way, a "Thumbs Up" would be greatly appreciated. Thank you!
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional