delphi+mapx中的放大问题(100分)

H

hameizi

Unregistered / Unconfirmed
GUEST, unregistred user!
用delphi的mapx控件做的程序,
但在显示图象的时候,只有一个小点点那么大,要多次放大才能看到 全图
我用zoom 或是zoomto 不行,一点击放大后连图象都看不到.

help!!!
 
T

tianjh007

Unregistered / Unconfirmed
GUEST, unregistred user!
你在装载完地图之后就指定一个合适的Zoom值试试
 
H

hameizi

Unregistered / Unconfirmed
GUEST, unregistred user!
问题是无论我的zoom 值为多大,图象都只有一个小点点大.而且放大按纽就不能用了
如果我用了mapx1.bounds:=mapx1.layers.bounds
就可以了,但图象的大小又恢复了原来的大小
 
T

tianjh007

Unregistered / Unconfirmed
GUEST, unregistred user!
可以的话把你的图发过来我试试tianjh007@163.com
 
H

hameizi

Unregistered / Unconfirmed
GUEST, unregistred user!
我的图是产权产籍系统的一部分,显示图的楼房信息部分,整个文件太大了,
只能贴出部分代码,还的麻烦你
帮看看!

下班了!
下午来
 
H

hameizi

Unregistered / Unconfirmed
GUEST, unregistred user!
下面是程序中的一个主要的部分,


application.createform(Tdisplay_map,display_map);
zmap:=display_map.maptool.ControlInterface;

for i:=zmap.layers.countdo
wnto 1do

zmap.Layers.reMove(i);
display_map.maptool.NumericCoordSys:=zmap.displaycoordsys;

for zi:=0 to tmplist.Count-1do

if alltrim(tmplist.strings[zi])<>'' then

begin

zmap.layers.Add(tmplist.strings[zi],zi+1);

lay:=zmap.layers.item(zi+1);
display_map.maptool.OleObject.datasets.add(6,lay,lay);

end;

//zdataset:=zmap.datasets.item(1);


if 2=2 then

for i:=1 to zmap.layers.countdo

for j:=zmap.layers.item(i).allfeatures.countdo
wnto 1do

begin

zfeature:=zmap.layers.item(i).allfeatures.item(j);
do
ne1:=false;
zi:=-1;
k:=1;
while k<=zmap.datasets.countdo

begin

if zmap.datasets.item(k).layer.name=zmap.layers.item(i).name then

begin
zi:=k;break;
end;

inc(k);
end;

do
ne:=true;
if zi>0 then

begin

zdataset:=zmap.datasets.item(zi);
do
ne1:=false;
for k:=1 to zdataset.fields.countdo

if zdataset.fields.item(k).name='代码' then

begin
do
ne1:=true;break;
end;

do
ne2:=false;
for k:=1 to zdataset.fields.countdo

if zdataset.fields.item(k).name='丘号' then

begin
do
ne2:=true;break;
end;

do
ne3:=false;
for k:=1 to zdataset.fields.countdo

if zdataset.fields.item(k).name='幢号' then

begin
do
ne3:=true;break;
end;



do
ne:=true;
code:='';location:='';land_no:='';room_no:='';build_no:='';
if (done1 anddo
ne2 anddo
ne3) then

begin

//tmpv:=display_map.maptool.oleobject.layers.item(1).allfeatures.item(j);
//tmpv1:='代码';
tmpv:=zdataset.value[zfeature,'代码'];
if (vartype(tmpv)=varString) or (vartype(tmpv)=varOleStr) then

code:=tmpv;
tmpv:=zdataset.value[zfeature,'丘号'];
if (vartype(tmpv)=varString) or (vartype(tmpv)=varOleStr) then

land_no:=tmpv;
tmpv:=zdataset.value[zfeature,'幢号'];
if (vartype(tmpv)=varString) or (vartype(tmpv)=varOleStr) then

build_no:=tmpv;
code:=alltrim(code);
location:=alltrim(location);
land_no:=alltrim(land_no);
build_no:=alltrim(build_no);
if room_map_in.land_no<>'' then

if (code=speccode[1]) and (land_no=room_map_in.land_no) and
(build_no=room_map_in.build_no) then

do
ne:=false;
end;

end;
//end of if zi

case zfeature.type_ of
miFeatureTypeRegion:
begin

zfeature.style.RegionBorderColor:=micolorblack
zfeature.style.RegionBorderWidth:=iif(done,1,3);
end;

miFeatureTypeLine:
begin

zfeature.style.LineColor:=micolorblack;
zfeature.style.linewidth:=iif(done,1,3);
end;

miFeatureTypeSymbol: zstyle.SymbolFontColor:=micolorblack;
miFeatureTypeMixed:
begin

zfeature.style.RegionBorderColor:=micolorblack;
zfeature.style.RegionBorderWidth:=iif(done,1,3);
end;

//miFeatureTypeUnknown:;
miFeatureTypeText:
begin

// zfeature.style.TextFontColor:=micolorblack;
//tmpv:=display_map.maptool.oleobject.layers.item(i).allfeatures.item(j).style.textFontRotation;
end;

end;

//if zfeature.type_<>miFeatureTypeText then

begin

//zfeature.style:=zstyle.Clone;
//zmap.Layers.item(1).Updatefeature(zfeature,zfeature);
zfeature.Update;
end;

***************************************************************
end;


但显示的图象只有一点点大!

曾经想在**********************
处用zoom 值定位图象的大小,总是失败
 
T

tianjh007

Unregistered / Unconfirmed
GUEST, unregistred user!
代码上看不出什么来
可能是你的图上有一些原来画了后来又被删除的图元
你到这问问http://www.gischina.com/bbs/default.php
这边MapX的高手好像多一些
不好意思,帮不了你了
 
H

hameizi

Unregistered / Unconfirmed
GUEST, unregistred user!
还是很谢谢
 
H

hameizi

Unregistered / Unconfirmed
GUEST, unregistred user!
接受答案了.
 
顶部