-1

I tried to change the icon of mapMarkers but it corresponds to the list description and not to the markers themselves. This line displays a map with red markers :

component.set('v.mapMarkers', response.getReturnValue());

Whenever I try to change their icon, that's not working anymore :

var image = '{!URLFOR($Resource.MapMarkers, \'2.png\')}';
component.set('v.mapMarkers', {
     location: response.getReturnValue(),
     icon: image
});

I also tried this : http://releasenotes.docs.salesforce.com/en-us/summer15/release-notes/rn_vf_maps_enhancements_custom_icons.htm?edition=&impact=

Any idea ?

1 Answers1

0

That looks like Aura component? Or is it Visualforce? Or Lightning Web Component?

For Aura: https://developer.salesforce.com/docs/component-library/bundle/lightning:map/documentation Search on this page for icon: 'standard:account'

You can't load your own icon, you're limited to icons defined in Lightning Design System. The format is category:icon_name.

eyescream
  • 18,088
  • 2
  • 34
  • 46
  • That was Aura component indeed. Is that possible without using lightning:map ? Like consctructing map with google map directly or with leaflet ? – Caikozolyv Jul 16 '19 at 07:19
  • I've done a manual Google Map integration back in 2010 (https://stackoverflow.com/questions/3122038/how-do-i-integrate-salesforce-with-google-maps) + you might find some blogs, examples. Not sure if they'll still work, back then you needed Google API key, libraries & functions might have changed... Is that custom icon absolutely necessary and warrants hand-crafting it all from scratch? Maintaining? Maybe obtaining a license from Google, Here.com etc? Might be not worth the effort. – eyescream Jul 16 '19 at 11:17