function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Issac ChuaIssac Chua 

lightning:map limitation

I am using lightning component of <lightning:map> to generate the list of markers on the map. I am following the examples on the salesforce lightning component website:

https://developer.salesforce.com/docs/component-library/bundle/lightning:map/example

Everything works perfectly, except that when the returned list is larger than a certain number, say over 50 or 100 or so. Then, the map markers cannot be generated.

I think it has something to do with the Google Map API key. How am I going to use my own Google Map API key with no limitation if it is the case? Thanks anyone for any contribution to this matter!

 
Best Answer chosen by Issac Chua
Jihad AZAMIJihad AZAMI
There is no limitation, i'm using <lightning:map> and i can display a list of 1000 3000 element,
But if you have 1 element wrong in your 100 list the markers will not appear

So you have to filter the positions before put it in your list


Usage Considerations
All latitude and longitude values must be valid. If you pass in an invalid latitude or longitude, the markers are not plotted on the map. Latitude values fall within -90 and 90, and longitude values fall within -180 and 180.
Additionally, consider the following:
If you specify an address, you must provide at least one of the following values: City, PostalCode, State or Country.
If you pass in both an address and a latitude and longitude, the map plots the marker according to the latitude and longitude values.
If a marker in the mapMarkers array is invalid, no markers are plotted on the map.

All Answers

Jihad AZAMIJihad AZAMI
There is no limitation, i'm using <lightning:map> and i can display a list of 1000 3000 element,
But if you have 1 element wrong in your 100 list the markers will not appear

So you have to filter the positions before put it in your list


Usage Considerations
All latitude and longitude values must be valid. If you pass in an invalid latitude or longitude, the markers are not plotted on the map. Latitude values fall within -90 and 90, and longitude values fall within -180 and 180.
Additionally, consider the following:
If you specify an address, you must provide at least one of the following values: City, PostalCode, State or Country.
If you pass in both an address and a latitude and longitude, the map plots the marker according to the latitude and longitude values.
If a marker in the mapMarkers array is invalid, no markers are plotted on the map.
This was selected as the best answer
Issac ChuaIssac Chua

Hi Jihad, thanks for your reply. You are right about it. It was because the address is invalid, hence causing the map failed to load the markers. I was wondering what is the best way to make sure the address is valid, or auto generating geolocation based on the address input. I see data.com does provide such functionality, but I think I will keep looking around for possible solution.

Thanks again for your reply!

Issac ChuaIssac Chua
Updates: for anyone who is looking for generating geocode based on address, the feature has already been delivered on Summer 16. You just need to go to Setup and look for Data Integration Rules and enable the geocode that you need.