FNC Map Marker Color

For FNC Maps using Google Maps
If I have 3 markers on my map and I want them all to be different colors, is the only way to do this is via the IconURL property to load a different Icon for each marker?
And
How do you change the default Marker color from Red to something else?

Thanks

Hi,

Please note that the red marker is the default marker as provided by the Google Maps API.
There are currently no other colors available.
You can indeed use the IconURL property to display a custom image for each marker.
The IconURL can be an URL to a remote image file, a local image file (with LocalFileAccess set to True) or Base64 encoded image data.

1 Like

Bart,
If I wanted to use base64 image data, would I do so with something like
Marker.IconURL:= 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAYAAAA9zQYyAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzA...';
If this isn't correct, could you provide a sample.
Thanks

Bart,

Actually I tested this and it works, so I can use a Base64 string (Constant) to load my different color marker pins without having to use the internet to grab the .png files each time.

1 Like

Thanks for confirming, this is indeed the correct approach.

Hi,
you can set a Color over OnustomizeMarker!

mColor is the Value of the Color.

procedure TfrmMaps.FNCMapsCustomizeMarker(Sender: TObject;
var ACustomizeMarker: string);
var st: String;
begin
st := Inttohex(mColor,8);
ACustomizeMarker := 'marker.setIcon(''http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=•|'+copy(st,7,2)+Copy(st,5,2)+copy(st,3,2)+''')';
end;

1 Like