lyr := MyMap.Layers._Item('alarmdevice'); while not QueryFlash.Eof do
begin
str := Format('%d',[QueryFlash.FieldByName('mi_prinx').AsInteger]);
ft := lyr.Search(' mi_prinx = ' + str, EmptyParam);
if ft.Count <= 0 then continue; case ft.Item[1].type_ of
miFeatureTypeSymbol:
begin
//这里ft.Item[1].Style.SymbolBitmapName竟然为空串,我加载图层的时候有指定图层的SymbolBitmapName = 'AlarmDevice.BMP'
showmessage(ft.Item[1].Style.SymbolBitmapName); if ft.Item[1].Style.SymbolBitmapName = 'AlarmDevice.BMP' then
ft.Item[1].Style.SymbolBitmapName := 'STOP1-32.BMP'
else
ft.Item[1].Style.SymbolBitmapName := 'AlarmDevice.BMP';
ft.Item[1].Style.SymbolBitmapSize := 24;
ft.Item[1].Style.SymbolBitmapName := 'STOP1-32.BMP';
lyr.Selection.Replace(ft.Item[1]);
ft.Item[1].Update(EmptyParam, EmptyParam);
end;
end;
QueryFlash.Next;
end;
现在问题是更新了检索出的图元的样式,在地图上却体现不出新的样式来,请大家帮帮忙给看看。谢谢了
begin
str := Format('%d',[QueryFlash.FieldByName('mi_prinx').AsInteger]);
ft := lyr.Search(' mi_prinx = ' + str, EmptyParam);
if ft.Count <= 0 then continue; case ft.Item[1].type_ of
miFeatureTypeSymbol:
begin
//这里ft.Item[1].Style.SymbolBitmapName竟然为空串,我加载图层的时候有指定图层的SymbolBitmapName = 'AlarmDevice.BMP'
showmessage(ft.Item[1].Style.SymbolBitmapName); if ft.Item[1].Style.SymbolBitmapName = 'AlarmDevice.BMP' then
ft.Item[1].Style.SymbolBitmapName := 'STOP1-32.BMP'
else
ft.Item[1].Style.SymbolBitmapName := 'AlarmDevice.BMP';
ft.Item[1].Style.SymbolBitmapSize := 24;
ft.Item[1].Style.SymbolBitmapName := 'STOP1-32.BMP';
lyr.Selection.Replace(ft.Item[1]);
ft.Item[1].Update(EmptyParam, EmptyParam);
end;
end;
QueryFlash.Next;
end;
现在问题是更新了检索出的图元的样式,在地图上却体现不出新的样式来,请大家帮帮忙给看看。谢谢了
.........
Var
lyr : CMapXLayer;
finds: CMapXFeatures;
i,j:integer;
rv: CMapxRowvalue;
rvs: CMapxRowvalues;
ds:CMapxDataset;begin lyr:=map1.Layers.Item[edit1.text];
DS:=map1.DataSets.Add(miDatasetLayer,lyr,emptyparam,emptyparam, emptyparam,emptyparam,emptyparam,emptyparam);
finds:=lyr.Search('city="'+edit3.Text+'"',emptyparam);
i:=finds.Count;
while (i>0) do
begin
map1.ZoomTo(strtofloat(edit4.text),finds.Item[1].CenterX, finds.Item[1].CenterY);
lyr.Selection.Replace(finds);
rvs:=ds.Rowvalues[finds.Item[i]];
for j:=1 to ds.Fields.Count do
begin
showmessage(rvs.Item[j].value);
end; rvs.Item[1].value:=99; //為第一個欄位賦值(本例圖元有三個屬性)
rvs.Item[2].value:='bbb';//為第二個欄位賦值
rvs.Item[3].value:='cccc';//為第三個欄位賦值
finds.Item[i].Update(true,rvs);
i:=i-1; end;
if finds.Count=0 then showmessage('沒找到');
end;
.........
您好!能把你的MAPX 5 发份给我,我下载下来的在安装时老是提示有两个文件夹找不到,且安装后找不到相关的ocx文件,在delphi中的activex页面也找不到mapx相关的控件!
谢谢!