Hi Mike,
 
There is a tool at the Directionsmag site that will do this for you.  Do a 
search for viewselection-96.zip under the tools for MapInfo.  It comes with the 
MB and the MBX.  It was posted by Ken Fioretti back in 1999.
 
Don.

S�ren Breddam <[EMAIL PROTECTED]> wrote:
Hi Mike,
Try this:
'*****************Code Begin*************************

sub zoom

dim i as float,
j As SmallInt
Run menu command 306 ' Browse to selected - usefull if you've got a
browser open


if SelectionInfo(SEL_INFO_TABLENAME)=""
then goto err
end if

for j=1 to NumWindows()

Onerror goto err
if windowinfo(j, WIN_INFO_TYPE)=1
then
i=WindowId(j)
Add Map 
Window i
Layer Selection
Set Map 
Window i
Zoom Entire Layer 1
'Exit Sub ' If you don't want all your map windows to zoom
to selected
end if
next


close table SelectionInfo( SEL_INFO_SELNAME)


err:

end sub
'************************Code End*******************
Ctrl+g zooms to selected, but only if your zoom level is to small to fit in
all selected objects.

HTH

Regards

S�ren Breddam
GIS- og IT-koordinator
Teknik og Erhvervsforvaltningen
Stevns Kommune - www.stevns.dk 
* Tlf.: 5656 1800
* Dir.: 5656 1891



-----Oprindelig meddelelse-----
Fra: Mayer, Mike @ Vancouver [mailto:[EMAIL PROTECTED]
Sendt: 26. april 2005 22:56
Til: '[email protected]'
Emne: MI-L Zoom to selected Features


Hello Everyone,

Could anyone tell me how I can zoom in to features that are selected from a
table. I have a browser window that appears after a select statement has
executed, I want to take the features that are selected and zoom into them
on the map. I am trying to do this through MapBasic. Any ideas? Thanks in
advance.

Mike Mayer

---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 16237

---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 16238



Yours truly,

Don Mitchell, FT, GIS PG
385 Highview Drive
St. Thomas, ON
N5R 5Z5
email: [EMAIL PROTECTED]
__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to