> --
> You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
> To post to this group, send email to google-map...@googlegroups.com.
> To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
>
On Feb 14, 12:00 am, Ben Appleton <apple...@google.com> wrote:
> Yes, you can implement a custom MapType
> (http://code.google.com/apis/maps/documentation/v3/reference.html#MapType)
> with custom Projection that implements your UTM. Then all overlays
> (markers, polylines, etc.) will use UTM.
A simple documentation example (Euclidian Projection) might be
useful. UTM is not trivial. Both Easting & Northing depend on both
Latitude & Longitude. Zone depends on Longitude.
Sorry
Philip
In v3 the API handles zooming.
On 19 Feb 2010 14:30, "Philip" <philip...@gladstonefamily.net> wrote:
This is doable in V2 maps -- I have a projection that supports UTM for
the old maps. It seems that the projection support in V3 maps is not
yet baked. I don't see how to actually implement a projection with the
API that is specified -- in particular, there is no zoom parameter
passed to the projection. Calculating pixel coordinates without
knowing the zoom is tough.
Sorry
Philip
On Feb 13, 6:50 pm, jbogdani <jbogd...@gmail.com> wrote:
> My answer is: Is there any way to work i...
The only reference to zoom in MapCanvasProjection is:
getWorldWidth() number The width of the world in pixels in the
current zoom level.
If I am implementing a MapCanvasProjection, then how do I discover the
current zoom level? [Bear in mind you can have multiple maps on the
same page, each with different zoom levels, and no way to reach any
map object from the MapCanvasProjection object]
I suspect that each of the methods is missing a zoom parameter. You
certainly wouldn't want to make the current zoom a property of the
projection.
Philip
On Feb 19, 1:30 am, Ben Appleton <apple...@google.com> wrote:
> In v3 the API handles zooming.
>
Not really.
I already pointed you to documentation that demonstrates how to do it,
but I believe that you chose to ignore my advice when you said "I
understand how projections work".
Just to be on the safe side, I tried what I suggested in the other
thread, and I can get pixel coordinates in 3 lines of code.
You need to un-learn what you know from V2 here.
BTW, I might have clicked "reply to author" by mistake in a previous
attempt to post this message, and if I did I'm sorry about that.
--
Marcelo - http://maps.forum.nu
--
From the example at http://code.google.com/apis/maps/documentation/v3/examples/map-coordinates.html
MercatorProjection.prototype.fromPointToLatLng = function(point) {
//stuff not referencing 'point' but referencing 'pixel'. This is a
pure typo I think
}
The definition of a MapCanvasProjection object does not include this
method, but assuming that it really is (another typo for)
'fromDivPixelToLatLng', lets see what the documentation says about
this method: "Computes the geographical coordinates from pixel
coordinates in the div that holds the draggable map." (http://
code.google.com/apis/maps/documentation/v3/
reference.html#MapCanvasProjection )
Now -- what are the 'pixel coordinates'? I assumed (and this may be a
bad assumption) that the units are in pixels. Now, I will admit that
the documentation does not define 'pixel coordinates', but I think
that most people would assume that this was 'the coordinates in
pixels'.
If we could find an instance of a MapCanvasProjection object from one
of the google defined map types, then we could solve this issue pretty
easily (by looking at the methods and parameters of those methods).
Philip
On Feb 19, 10:46 am, Marcelo <marcelo...@hotmail.com> wrote:
> On Feb 19, 4:27 am, Philip <philip-goo...@gladstonefamily.net> wrote:
>
> > Calculating pixel coordinates without
> > knowing the zoom is tough.
>
> Not really.
> I already pointed you to documentation that demonstrates how to do it,
> but I believe that you chose to ignore my advice when you said "I
> understand how projections work".
> Just to be on the safe side, I tried what I suggested in the other
> thread, and I can get pixel coordinates in 3 lines of code.
> You need to un-learn what you know from V2 here.
>
> BTW, I might have clicked "reply to author" by mistake in a previous
> attempt to post this message, and if I did I'm sorry about that.
>
> --
> Marcelo -http://maps.forum.nu
There was a discussion either in this group or in an issue in the
issue tracker about why the base projection was not available. It had
to do with not exposing objects that were loaded asynchronously if I
recall correctly.
Chad Killingsworth
On Feb 19, 11:03 am, Philip <philip-goo...@gladstonefamily.net> wrote:
> I agree that I can (too) get pixel coordinates by scaling the pixel
> coordinates by 2**zoom. However, that isn't what the documentation
> tells you to do. The example does that. I admit, but I also think that
> the example is wrong for other reasons.
>
> From the example athttp://code.google.com/apis/maps/documentation/v3/examples/map-coordi...