hi,everybody!
i want to know how to transform the following codes to v3.
(ps. i don't know how to use "google.maps.MapType" and
"google.maps.Projection".
and then my English is very hard.[?] )
//-------------------------------------------------------------------------------------------------------------------------------
//定义特定的投影
function dituProjection(xOffset,yOffset){
this.xOffset = xOffset;
this.yOffset = yOffset;
}
dituProjection.prototype = new GProjection();
dituProjection.prototype.fromLatLngToPixel =
function(latlng,
zoom){
return
(G_NORMAL_MAP.getProjection()).fromLatLngToPixel(new
GLatLng(latlng.lat()+this.xOffset,latlng.lng()+this.yOffset),zoom);
};
dituProjection.prototype.fromPixelToLatLng =
function(pixel,zoom,unbounded)
{
var latlng =
(G_NORMAL_MAP.getProjection()).fromPixelToLatLng(pixel,zoom,unbounded);
return new
GLatLng(latlng.lat()-this.xOffset,latlng.lng()-
this.yOffset);
}
dituProjection.prototype.tileCheckRange =
function(tile, zoom,
tilesize)
{
return
(G_NORMAL_MAP.getProjection()).tileCheckRange(tile,zoom,tilesize);
}
dituProjection.prototype.getWrapWidth =
function(zoom)
{
return
(G_NORMAL_MAP.getProjection()).getWrapWidth(zoom);
}
var newMap = new
GMapType(G_NORMAL_MAP.getTileLayers(), new
dituProjection(xOffset,yOffset), '地图(校正后)');
map.addMapType(newMap);
map.removeMapType(G_HYBRID_MAP);
map.removeMapType(G_SATELLITE_MAP);
//map.removeMapType(G_NORMAL_MAP);
//G_SATELLITE_MAP.getName = function(){
return '卫星(无校正)';};
//G_NORMAL_MAP.getName = function(){ return
'地图(校正前)';};
//--------------------------------------------------------------------------------------------------------------------------------
thank you!
2010/9/1 [email protected] <[email protected]>
> On Aug 31, 10:16 am, YeeFung Man <[email protected]> wrote:
> > hi,i have a problerm about transform v2 to b3.
> > this code can run at v2,and how to transform.
> >
>
> Where is the map that you tried to port but doesn't work?
> http://groups.google.com/group/google-maps-js-api-v3/t/2b3f101fd509919e
>
> > var polyline1_1 = new GPolyline.fromEncoded({
> v3 does not support encoded polylines or polygons, you will have
> encode/decode them yourself. Mark McClure has code to do that here:
> http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/
>
> The other obvious difference is the "G*" namespace is no longer
> supported, it translates to google.maps.* for the most part (if the
> functionality exists in v3).
>
> -- Larry
>
> --
> 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
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-maps-js-api-v3%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
>
--
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 [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-js-api-v3?hl=en.
<<323.gif>>
