Register  |  Login
ThinkGeo - GPS Tracking and Mapping Solutions  |  Home  |  Cygnus Track  |   Code Community

Discussion Forums

The online community for users of Map Suite GIS components

Zoom to Lat/Long
Last Post 05-08-2009 05:12 PM by ThinkGeo. 6 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
GregoryUser is Online
Level 4
Level 4
Posts:192
Avatar

--
01-28-2008 04:23 PM

 

If I know the lat/long, how can I zoom to that location? Let's say I want to zoom to -80.3862,25.9029 on center, with a 50-foot buffer. I tried the following code:

RectangleR newExtent = new RectangleR(new PointR(x1, y1), new PointR(x2, y2));
Map1.CurrentExtent = USARenderers.GetExtent(13, newExtent);

 

However, that seems to put me off into the ocean somwhere. Any advice?

 

 

ValUser is Offline
MVP
MVP
Posts:799
Avatar

--
01-28-2008 05:02 PM
We don't know the values of x1, y1, x2 and y2. We would need to know those values and how you get them.
Thank you.
GregoryUser is Online
Level 4
Level 4
Posts:192
Avatar

--
01-28-2008 05:08 PM
Thank you for your reply, but if you read my initial post clearly, you would have learned that I described what the x1, y1, x2 and y2 coordinates should be:

-80.3862,25.9029 on center, with a 50-foot buffer

I only included the code to illustrate how I am setting it now, by updating the CurrentExtent on the map (which does not work).
ValUser is Offline
MVP
MVP
Posts:799
Avatar

--
01-28-2008 05:26 PM
If you want to get an extent from a point at location -80.3862, 25.9029 with a 50 foot buffer, try the following code:

MapSuite.Geometry.Ellipse Ellipse = new MapSuite.Geometry.Ellipse(new PointShape(-80.3862, 25.9029), 50, Map1.MapUnit, MapLengthUnits.feet);
Map1.CurrentExtent = Ellipse.Envelope.ToRectangleR();
GregoryUser is Online
Level 4
Level 4
Posts:192
Avatar

--
01-30-2008 11:25 AM
Thanks! Your solution was "almost" perfect. I only had to add the following to get it to work with RenderUSA:

Map1.CurrentExtent = USARenderers.GetExtent(13, Ellipse.Envelope.ToRectangleR());
VivekUser is Offline
Level 1
Level 1
Posts:21
Avatar

--
05-05-2009 09:19 AM

Hello All

I am using a Thinkgeo map

I have WebEdition ddl version 3.1.16.0.

i am unable to find the  the Geometry funtion in Mapsuite to get a distance between two point in map. "MapSuite.Geometry..Ellipse.

i want same thing that i have value  langtitude and latitude which on center and cover the 50 miles area from the center.

How can i create it without   Gemoerty because it has been changed to a function of BaseShape since 3.0.

i need to create  reactangle instead of Ellipse.

 

 

 

ThinkGeoUser is Offline
MVP
MVP
Posts:1596
Avatar

--
05-08-2009 05:12 PM

Vivek,

I have recreated your post in the correct section of the Forums here: http://gis.thinkgeo.com/tabid/143/a...fault.aspx

You are not authorized to post a reply.

Active Forums 4.2