| Issue 2181: | The projection property of the basemaps is not present | |
| 8 people starred this issue and may be notified of changes. | Back to list |
If you can get hold of the MapType object that is the current basemap, then it's projection property is missing.
Mar 4, 2010
Project Member
#1
[email protected]
Status:
NeedsMoreInfo
Mar 4, 2010
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
setTimeout(function () {
var basemap = map.mapTypes.get(google.maps.MapTypeId.ROADMAP);
alert("basemap = " + basemap + ", basemap.projection = " +
basemap.projection);
}, 1000);
You have to wait a bit for the mapTypes registry to get populated....... There is
probably an event when this gets populated, but the test program just waits a second.
BY this stage the map is painted on the screen, so the basemap is fully present.
Output on firefox 3.5 on Windows xp is:
basemap = [object Object], basemap.projection = null
i.e. the projection object is missing (or maybe the property name is wrong in the
documentation).
Mar 4, 2010
I forgot to include the link (duh!) http://pskreporter.info/grid/testproj.html
Mar 5, 2010
I'm looking into this. I am curious as to what you want to use the projection for?
Mar 5, 2010
I was trying to build a MapType to use as an overlay on an existing map. The drawing framework calls my maptype object to get tiles. I can calculate the pixel coordinates for the corners of the tile, but need the projection object to calculate the lat/lng coordinates. This really only makes a difference if the basemap is not using Mercator, but (say) using UTM. In fact, I think that lots of things will start to break in this case, and it isn't clear that the model is right. For example, if I have a MapType that I am using as a basemap that uses a UTM projection, then it probably only makes sense to overlay other MapType objects that have the same projection (otherwise stuff will not line up). Some types of overlays will be able to handle multiple projections (for example, a vector drawing overlay), but some will not (those that are made up of image tiles). My original project was http://pskreporter.info/grid/test.html This draws the day/night terminator as a MapType. Each tile is actually a CANVAS (so this demo doesn't work in IE) and is calculated locally. I ended up assuming that the underlying map projection was mercator, but (in theory) I could render the day/night terminator for *any* projection. But I have to know what that projection is. Hope this makes sense. Philip
Apr 5, 2010
(No comment was entered for this change.)
Labels:
Fixed-35
Apr 5, 2010
(No comment was entered for this change.)
Status:
Fixed
|
|
| ► Sign in to add a comment |