简体   繁体   中英

Change GMLib default marker

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM