On Apr 8, 6:56 pm, Grete <[email protected]> wrote:
>
> my task is o program a rectangle-function for Google maps. The problem
> is that the rectangle must not be parallel to the coordinate system.
>
> First, the user draws a baseline. Starting from this base line, the
> application offers a new line that is perpendicular to the last drawn
> point. The length of the line is tied to the mousemove event and
> corresponds to the vertical distance of the cursor to the last drawn
> line. The next click will complete the line and offered a new line.
>
> I am grateful for any information!

This is a simple enough geometry problem. But there is a twist.

Define your rectangle. Do you mean that it needs to look rectangular
on a Mercator map? Or do you want each corner to be ninety degrees on
the ground? Have a look at
http://www.ordnancesurvey.co.uk/images/userImages/misc/gps/coordinatesystemsinfo/fig8.gif
-- this shows rectangles drawn on the surface of the globe. At the top
of the map, the 100km squares cross more degrees than at the bottom.
In a Mercator map, the (solid) lines of longitude are parallel; that
means that the grid squares would splay out towards the top of the
map. On a Mercator map, the grid squares would not be anything like
square.

Conversely, a square drawn on a Mercator map would look like a square,
but if you plotted it on the globe it would be squished as you went
north.

Drawing perpendiculars from an arbitrary line is fairly
straightforward and there are formulae to do it which I'm sure you can
find. But you need to decide how you are measuring your rectangle.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to