Unstoppable Domains

Google Maps API simple things. . .need help

Spaceship Spaceship
Watch

omegapandor

Established Member
Impact
4
I'm doing a google maps site. It's a game, oddly enough. Although the information I am looking for will definitely come in handy for anything else down the road.

I already have the basic stuff set up, including a map that reads from a drupal database (map isn't set up inside drupal yet, but I have edited drupal where users can set their address to be geocoded into the map).

So right now I am trying to figure out how to implement some things:

1. distance between 2 markers or user locations in the database (I can probably do this one myself with Haversine forumla but I don't know a good way to implement the inputs)
2. what country a marker is in (maybe not so simple, I guess?)
3. permanently moving a marker a limited distance without click-dragging
4. limited sight distance depending on zoom (for the case of tons of markers)
5. different stock marker icon color (but not custom image)

I'm just looking for some default-google-api friendly source code.

For now, I'm hoping a kind soul will help me with a least one of these things gratis or for advertisement or something. I would definitely be willing to put a non-adult non-gambling link in my sig for you for. . .say. . . until august or something.
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable DomainsUnstoppable Domains
These things are awesome... just View Source on these examples and you can probably step yourself through the Javascript enough to add it to your site:

http://code.google.com/apis/maps/documentation/examples/

There are some more advanced things that you want to do, which the API may not be able to do for you (but I'm not too experienced w/ it so I wouldn't really know)... for example, find out what country a marker is in.

Your thing #1 may be provided by the API (with a little tweaking), however you might dissect this: http://www.daftlogic.com/projects-google-maps-distance-calculator.htm

Good luck!
 
1
•••
Thanks. I actually new about daftlogic - that site served as a major inspiration as far as the decision to use google maps goes. It had only occurred to me about a day ago that I could view the source of many google maps on the net. Unfortunately for me, daft logic seems to use some method to hide the map api code.

I have found a distance example on another site and used its source. The accuracy seems ok for short distances, and the function is built-in.
wisgary distance calculator


I forgot about the code.google.com examples! Thanks.

Right now my major problem is trying to get a php script to run via javascript. There seems to be some kind of "fake image" trick, but it isn't working for me.

Um. . . Thanks for the reply. . .Rep added!
 
0
•••
omegapandor said:
Thanks. I actually new about daftlogic - that site served as a major inspiration as far as the decision to use google maps goes. It had only occurred to me about a day ago that I could view the source of many google maps on the net. Unfortunately for me, daft logic seems to use some method to hide the map api code.

I have found a distance example on another site and used its source. The accuracy seems ok for short distances, and the function is built-in.
wisgary distance calculator


I forgot about the code.google.com examples! Thanks.

Right now my major problem is trying to get a php script to run via javascript. There seems to be some kind of "fake image" trick, but it isn't working for me.

Um. . . Thanks for the reply. . .Rep added!
Thank you!

Regarding:

Right now my major problem is trying to get a php script to run via javascript.
Learn how to use the XMLHttpRequest object in Javascript. That's the basis for the AJAX thinking, which can run PHP from Javascript. http://www.w3schools.com/ajax/ajax_intro.asp
 
0
•••
Yeah, I figured I'd have to learn it sooner or later. I was hoping there was some kind of shortcut, because I looked at the principles of AJAX and it seemed like a lot for me at the moment, especially for what I'm trying to do. I guess I'll just have to man up and learn that object. :td:


AJAX = :$: in the long run, anyway, I suppose.

Thanks for the link. Although to be honest. . .w3schools has been in my bookmarks toolbar for quite some time. B-)
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99
Appraise.net

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back