On Apr 5, 1:54 pm, tanoshimi <[email protected]> wrote:
> I don't know if you realise or not, but your tone of voice comes
> across as very rude in most of the emails above.
> Remember that you are here asking for help - nobody here is obliged to
> give it to you, but they'll be more likely to do so if you are polite
> and appreciative of their taking their time to answer your questions.
Yeah but it doesn't mean I have to put down my guard to cyber-bullies,
trolls, or people
who delight in going into threads just to contradict a thread starter,
or who have no intent of helping
but just manipulate conversations or topics. If you no nothing about
the url I posted and are not a
Google tech that can explain it then you can't give me any help. And
you are here just to post
rubbish like dictating to me what you thought I posted and in error
replied with misinstruction
based upon misjudgement. No tanoshimi I never said it had anything to
do with Microsoft.
But over on Charlie Savage's site he says,
<code>
This post is long overdue - a number of people have asked me how to
convert between lat/long and mouse coordinates on an HTML page. First,
let's define some terms since otherwise is easy to get confused:
* Geodetic coordinate system- A geodetic coordinate system based
on the WGS84 datum.
* World coordinate system - The projected coordinate system - for
example, the Mercator projection used by Google.
* Document coordinate system - The browsers coordinate system,
units are in pixels.
* View coordinate system - The coordinate system of the HTML
element, such as a div tag, that contains the map. Units are in
pixels.
Since writing out coordinate system gets tedious pretty quickly, I'll
abbreviate it as CS.
A Series of Transformations
Transformations are used to convert coordinates between different
coordinate systems. There are two types of transformations commonly
used in mapping.
The first is projection transformations which convert to and from a
geodetic CS to a projected CS like Mercator or UTM. Projection
transformations are often non-linear and require fairly complex math.
The second is affine tranformations. Affine transformations are used
to translate (i.e., move), scale, rotate and skew features. Affine
transformations are linear and are used by all drawing programs and
are often used in games (pick up any book about math for game
developers to learn more about affine transformations). They are easy
to implement using linear algebra.
So back to the problem at hand. To get from a lat/long value to a
pixel value requires a series of transformations:
1. Geodetic CS -> World CS (projection)
2. World CS -> View CS (affine)
3. View CS -> Document CS (affine)
We've already know how to transform a point between the Geodetic CS
and World CS. And step 3 is easy. But how do we do step #2?
Its done like this:
1. Translate the world CS center to 0,0
2. Rotate the map if needed
3. Scale the map to the view CS
4. Translate from 0,0 in the view CS to the center of the view CS.
Why the translation to 0,0 first? The image below from O'Reilly's SVG
Essentials book shows the problem. The small rectangle's top left is
at 5,5. Now let's scale the rectangle by a factor of 2 to make the
bigger rectangle. Note that the new rectangle is not only larger, its
top left corner has also shifted to 10,10.
</code>
So now do you see why I made a point to direct any explanations away
from trying to go beyond the scope of the needed
things?????
Savage goes into talking about Document's coordinate system and that
is application specific and most likely OS specific since Microsoft
uses device contexts, bitmaps, and what not. And sometimes meaning it
has to be delt with not
with the screen or window but the client area's coordinate system.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---