更改GMLib默认标记 [英] Change GMLib default marker
问题描述
我在delphi应用程序中使用gmlib,它符合我的需要。我加载标记形成一个坐标表,但现在我要替换默认的标记样式。由于我在代码中这样做,我没有任何gmmarker项目。我的代码简单地循环:
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?
推荐答案
TGMMarker的添加方法返回一个TMarker对象。您可以使用它来分配更多的属性,如Icon属性。然而,gmmarker1.Items [0] .Icon或gmmarker1 [0]。如果存在任何标记,则必须工作。检查gmmarker1.Count before
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
这篇关于更改GMLib默认标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!