You need to be working in map/pixel coordinates (x, y), not geographic
coordinates (lat, lng). The projection from the latter to the former
is Mercator, modulo some linear tweaks of the y coordinate axis (see
<http://en.wikipedia.org/wiki/Mercator_projection>). In Mercator,
coordinate changes Δx and Δy are designed to be the same over short
distances, and therefore so will be the azimuth ~ arctangent (Δx/Δy).

I haven't tried this, but I think you can do the following: convert
your (lat, lng) to pixels with

      p:GPoint = map.fromLatLngToContainerPixel(GLatLng(lat, lng))

Then with your chosen displacement in pixels, calculate your new x and
y with

      x = p.x + disp * Math.sin(azimuth)
      y = p.y - disp * Math.cos(azimuth)

and then calculate the new marker position with

      marker:GLatLng = map.fromContainerPixelToLatLng(GPoint(x, y))

-- Andy

On May 30, 3:54 pm, JavaJive <[email protected]> wrote:
> I am trying to create a marker to show where to point a satellite
> dish....
>
> I have a routine that works out the azimuth for the dish, and under
> Open Layers I take the point representing the dish site, construct
> another due north by the length of the marker line, and then rotate
> the second about the first by the required azimuth ...
>         var p1 = new OpenLayers.Geometry.Point( aLonLat.lon, aLonLat.lat );
>         var p2 = new OpenLayers.Geometry.Point( aLonLat.lon, aLonLat.lat +
> markerLength );
>         p2.rotate( -anAzim, p1 );
> ... and this gives the correct azimuth.  ....
>
> In the Google API, I can get the required direction by creating the
> second point on the equator beneath the destination satellite ...
>         createDragLineMarker( loc, new google.maps.LatLng(0, 28.2) );

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to