I am trying to create a marker to show where to point a satellite
dish.

I already have a working web-page, using Open Layers to load a Google
Map ...
        
http://www.macfh.co.uk/JavaJive/AudioVisualTV/SatelliteTV/SatelliteCalculator.html
... but due to some bugs that have appeared in OL in the last six
months or so, I am trying to convert this to use the Google mapping
API.  My problem is trying to get an accurate marker.

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.  Here's a simplified example
showing the direction for Astra 2D from the 'meridian' line marker at
the Royal Observatory in Greenwich Park, London:
        http://www.macfh.co.uk/Test/Google_with_OpenLayers.html

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) );
        ...
        function createDragLineMarker( loc1, loc2 )
                {
                ...
                GoogleMarker    = new google.maps.Marker( loc1,
{draggable:true,bouncy:false} );
                GoogleMap.addOverlay( GoogleMarker );
                GoogleMarkerL   = new google.maps.Polyline( [loc1, loc2], 
markerColor,
markerLineWidth, 1, {geodesic:true} );
                GoogleMap.addOverlay( GoogleMarkerL );
... and as long as the geodesic option is set, this too works:
        http://www.macfh.co.uk/Test/Google_with_Google.html

So far so good.  But the above method won't work for an azimuth almost
exactly on the equator, as the direction line might be too short, so I
was wondering if I couldn't do something similar to Open Layers.  I
came up with the following ...
        createDragDirMarker( loc, anAzim );
        ...
        function createDragDirMarker( loc1, anAzim )
                {
                var rAzim = (90 - anAzim)*Math.PI/180;
                var loc2  = new google.maps.LatLng( loc1.lat() +
markerLength*Math.sin(rAzim), loc1.lng() + markerLength*Math.cos
(rAzim) );
                createDragLineMarker( loc1, loc2 );
                }
... where the function createDragLineMarker( loc1, loc2 ) is as
above.  However, this draws the line in a direction about +12 degrees
off where it should be.  Can anyone explain this?

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