google.maps.geometry.spherical.computeHeading

1,014 views
Skip to first unread message

Drumblane

unread,
Oct 8, 2011, 4:18:52 AM10/8/11
to Google Maps JavaScript API v3
Hi. I have a page using Google Street View as one way to illustrate a
gazetteer. The live page is created dynamically from nearly 10,000
entries on a database. Each entry has its own LatLng.
An example (non-dynamic) page is at http://www.kirkyards.co.uk/streetviewexample.asp
. I would really like to have the heading point to the marker. I found
an example where this is done using computeHeading at
http://geoapis.appspot.com/agdnZW9hcGlzchMLEgtFeGFtcGxlQ29kZRjRiQIM. I
realize I can set the heading manually, but this would mean amending
all the records in the database, and I'm not experienced enough at
javascript to get it to work... Help would be appreciated. Thank you.

geoco...@gmail.com

unread,
Oct 8, 2011, 4:41:27 PM10/8/11
to Google Maps JavaScript API v3
On Oct 8, 4:18 am, Drumblane <5drumbl...@googlemail.com> wrote:
> Hi. I have a page using Google Street View as one way to illustrate a
> gazetteer. The live page is created dynamically from nearly 10,000
> entries on a database. Each entry has its own LatLng.
> An example (non-dynamic) page is at

http://www.kirkyards.co.uk/streetviewexample.asp

>I would really like to have the heading point to the marker.

What marker? I don't see a marker in either example you provided a
link to.

> I found
> an example where this is done using computeHeading at

http://geoapis.appspot.com/agdnZW9hcGlzchMLEgtFeGFtcGxlQ29kZRjRiQIM

> I realize I can set the heading manually, but this would mean amending
> all the records in the database, and I'm not experienced enough at
> javascript to get it to work... Help would be appreciated. Thank you.

Help doing what? The examples that you provide do exactly what you
want.

-- Larry

Chris Broadfoot

unread,
Oct 9, 2011, 3:31:07 AM10/9/11
to google-map...@googlegroups.com
On Sun, Oct 9, 2011 at 7:41 AM, geoco...@gmail.com <geoco...@gmail.com> wrote:
What marker?  I don't see a marker in either example you provided a
link to.

I see the marker. It's kind of near the light house - very small and far away.

To the OP, I'm not sure what you mean by amending all the records in the database. In the example you linked, the heading is calculated completely within the browser - no need to go and edit your database.

Chris

--


Drumblane

unread,
Oct 9, 2011, 2:13:54 AM10/9/11
to Google Maps JavaScript API v3
Hi Larry, thanks for replying.
In my own example (the kirkyards site) I have set the heading in
panoramaOptions - pov - heading ##.
This purposely doesn't point to the target, which is 90 degrees to the
right (Lighthouse), to highlight my problem.
Ideally, rather than having to manually input the correct heading for
all street views in my project, I would like to have computeHeading do
this for me, but I can't figure the coding to get it to work...
Thanks again. Jim

On Oct 8, 9:41 pm, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:

Drumblane

unread,
Oct 9, 2011, 3:58:38 AM10/9/11
to Google Maps JavaScript API v3
Hi Chris.
Sorry if I'm not good at explaining...
I've taken my kirkyards example as far as I can and added comments in
it showing what I'd like to do.
It can be viewed at http://www.kirkyards.co.uk/streetviewexample2.asp
Marker size is another problem. It's OK in IE8 but gets smaller the
further away the target is....
Thanks again. Jim

On Oct 9, 8:31 am, Chris Broadfoot <c...@google.com> wrote:
> On Sun, Oct 9, 2011 at 7:41 AM, geocode...@gmail.com
> <geocode...@gmail.com>wrote:

Drumblane

unread,
Oct 9, 2011, 4:32:38 AM10/9/11
to Google Maps JavaScript API v3
Ooops.
Discovered my mistake.
Didn't know I needed to load the geometery library.....
All working now.
Thanks for your patience.
Jim

On Oct 9, 8:31 am, Chris Broadfoot <c...@google.com> wrote:
> On Sun, Oct 9, 2011 at 7:41 AM, geocode...@gmail.com
> <geocode...@gmail.com>wrote:
Reply all
Reply to author
Forward
0 new messages