Hi Jonathon

This is easy to do, but I think its worth pointing out that MBR for
objects ( which you need ) and MBRs for MAPS and tables are for
fundamentally different purposes.

You attached a message from Matt that referred to the MAP MBR. These are
only there to increase tha accuracy MapInfo can achieve as it only uses
4 byte longs to store real coordinates. The smaller your bounds the
higher the accuracy.

The purpose of bounds on each object are for spatial searching. If your
screen is centred on Bath and NES then it only needs to redraw objects
with MBRs that intereset the screen. Objects are "grouped" in the Map
file by their MBRS.

The answer to your question is straightforward as you implied. In your
own code when the user has done the "find" you can read back the object
found from the searched table. Within MapBasic you can read the four
coordinates for the MBR using ObjectGeography(found_obj,OBJ_GEO_MINX)
and the same for MINY,MAXX,MAXY.

Now set the screen to the averages ( ie MINX+MAXX/2,MINY+MAXY/2) and
then set to width (MAXX-MINX) or to achieve 10% more (MAXX-MINX) * 1.1

Actually theres a bit more maths than this as the aspect ratio of the
screen needs to be taken into account. You should also use MapperInfo to
get the four corners of the screen. Compute the aspect ratio of the
screen and of the found object. It the object is more "portraitey" than
the screen then you need to work with height. If the object is more
"Landscapey!" than the screen the code above working with width is
correct.

Hope this helps


Regards


Bob
(Wales)




In message <c=US%a=_%p=Yellow._Marketin%l=COMMS_SERVER-990805081517Z-
[EMAIL PROTECTED]>, Jonathan Stokes <[EMAIL PROTECTED]>
writes
>ahoy listers
>a MapBasic question here (and i imagine it will be dead simple). i have
>a number of MI tables that make up a map of the UK when opened togther
>in the same mapper window. one of the tables contains a series of
>regions within the UK (there are quite a lot of them - approx 180. we've
>wrtten some code which opens up all the tables in a mapper and then
>styles them up in the correct manner.
>
>what i want to be able to do now is to return the minimum bounds of each
>of these regions (we've come across the mbr function) when jumped too
>and then zoom in to those minimum bounds. It would also then be nice to
>be able to zoom out a bit (say by 10% or so). 
>
>any ideas  ???
>
>thanks in advance
>
>Jonathan   
>
>>-----Original Message-----
>>From: Matt.Wilkie [SMTP:[EMAIL PROTECTED]]
>>Sent: Thursday, August 05, 1999 12:37 AM
>>To:   [EMAIL PROTECTED] (E-mail)
>>Subject:      RE: MI maximum qty of points
>>
>>>There is a relatively simple method to fix points being quished
>>>against an imaginary line when combining tables.
>>>
>>>In MI 5.5 there is a mapbasic utility that enables you to change
>>>the bounds (or extents) of any table. Make the bounds large enough
>>>to encompass both tables you are trying to combine.
>>
>>Is that the CoordSys Bounds tool? Thanks for the pointer, at least
>>it's a work around (not very easy to use if you have a lot of tables
>>to combine tho').
>>
>>>If you have MI 5.0 or before then export the table to a MIF file
>>>and manually change the bounds in the MIF in any text editor. 
>>>Once again make the bounds (that is I think the bottom LH and top 
>>>RH corners) at least beyond the limits of the tables concerned.
>>
>>This approach might work better for my situation (perl is wonderful
>>for text regex/replace processing). Thanks for the idea.
>>
>>cheers,
>>
>>-matt
>>----------------------------------------------------------------------
>>To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
>>"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
>----------------------------------------------------------------------
>To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
>"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

-- 
Bob Young
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to