I am using gmlib in a delphi application and it's living up to my needs. I load markers form a table of coordinates, but now I want to replace the default marker style. Since I am doing this all in code, I don't have any gmmarker items. My code is looped simply:
gmmarker1.Add(qryPoints.FieldByName('lat').AsFloat,qryPoints.FieldByName('lon').AsFloat,address);
when I try to change the icon using:
gmmarker1.Items[0].Icon:='c:\measle.png';
I get an error 'Argument out of range'
Is it possible to change the default icon without adding an item to the marker? Or am I doing this wrong?
The Add method of TGMMarker returns a TMarker object. You can use it to assign more properties like Icon property. However, gmmarker1.Items[0].Icon or gmmarker1[0].Icon must be work if exists any marker. Check gmmarker1.Count before