Hi,
I'm having annoying problems with
Mapper_Info_Commands. I've got a VB front end, and heres the code under a 'test'
button called MapScale. I've been using it to test out returns from
Mapper_Info_stuff.
' mi is defined elsewhere as my
mapinfo object
' the present window is a map
window
Dim mapscale As
Variant
' Redefine Coordinate system and distance units as double check
msg = "Set Map Window " & mapid & "CoordSys Earth Projection 8, 79, ""m"", -2, 49, 0.9996012717, 400000, -100000 Center (534600,185100) Zoom 11410 Units ""m"" Preserve Zoom Display Zoom XY Units ""m"" Distance Units ""m"" Area Units ""sq m"" "
mi.do msg
msg = "Set Map Window " & mapid & " Distance Units ""m"" "
mi.do msg
msg = "Set Paper Units ""cm"" "
mi.do msg
msg = "MapperInfo(" & Str$(mapid) & ", " & Str$(MAPPER_INFO_SCALE) & ")"
mapscale = (mi.Eval(msg))
txtMapBasic.Text = mapscale
' Redefine Coordinate system and distance units as double check
msg = "Set Map Window " & mapid & "CoordSys Earth Projection 8, 79, ""m"", -2, 49, 0.9996012717, 400000, -100000 Center (534600,185100) Zoom 11410 Units ""m"" Preserve Zoom Display Zoom XY Units ""m"" Distance Units ""m"" Area Units ""sq m"" "
mi.do msg
msg = "Set Map Window " & mapid & " Distance Units ""m"" "
mi.do msg
msg = "Set Paper Units ""cm"" "
mi.do msg
msg = "MapperInfo(" & Str$(mapid) & ", " & Str$(MAPPER_INFO_SCALE) & ")"
mapscale = (mi.Eval(msg))
txtMapBasic.Text = mapscale
The result goes to a text box called txtMapBasic.
The following Mapper Info attributes do not work successfully and i have no idea
why.
ZOOM - way off figure - thats
also static after i zoom in.
XYUNITS - m, good.
AREAUNITS - sq m,
good.
CENTERX - yes,
works.
CENTERY - yes,
works.
COORDSYS_CLAUSE - ft, i have no
mention of ft anywhere in my code or workspace - this one puzzles
me
DISTUNITS - m,
good.
LAYERS - 1, no! its about
ten.
MAXX, MAXY, MINY, MINX - work
once then become static variables in after changing view
SCALE - way off
figure
Two problems seem to exsist, one is a refresh
problem, where a variable return is no longer updated in accordance with the new
map view. and the other is the strange notion of 'ft' as my coordinate units.
This may be causing my scale problems.
All this is leading hopefully to an automated
scaletext created with thumps a scale line onto a layout - in a sort of
automatic map production.
regards,
andrew bailey
