You need to sign in to do that
Don't have an account?
Issac 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!
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!
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
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.
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!