Using fromLatLngToPoint rather than fromLatLngToPixel seems to solve
this.

On Jan 7, 2:04 pm, BenP <[email protected]> wrote:
> Appologies for being new to the API, but having an issue with,
> fromLatLngToPixel
>
> I am trying to find the cursor position in pixels from a map, and have
> used TileDetector example as a base, but instead am using a 3D map,
> All works fine, until I put the map pitch to a high value (eg > 65),
> then the line
>
>  var pixpoint:Point = map.MERCATOR_PROJECTION.fromLatLngToPixel
> (currentLatLng, zoom);
>
> causes an error
> TypeError: Error #1009: Cannot access a property or method of a null
> object reference.
>         at com.google.maps.core::MercatorProjection/fromLatLngToPixel()
>
> I don't know why, the it fails when it does.
>
> thanks ben
>
> here is the relevant code (i think):
>
> map is 3D
>
>  <maps:Map3D id="map"
> key="ABQIAAAAwZG5Tk3XmQjBsSYWpMhjDRTYPii5jV_hkpAdDjO7FC1qk2ixWRR_xPwZI95Ly56xE1GpS_00Whcbeg"
>                  mapevent_mappreinitialize="map_onMapPreInitialize()"
>                  mapevent_mapready="map_onMapReady()" left="10"
> right="10" top="10" bottom="10"/>
>
>   private function map_onMapReady() : void {
> map.addEventListener(MapMouseEvent.CLICK, mouseUpdated);
>  }
>
> private function mouseUpdated(e:MapMouseEvent):void{
>                                 currentLatLng = e.latLng;
>                                  var zoom:Number = map.getZoom();
>                                  var pixpoint:Point =
> map.MERCATOR_PROJECTION.fromLatLngToPixel(currentLatLng, zoom);
>                 }
-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API For Flash" 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-for-flash?hl=en.


Reply via email to