[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 07-08-2008, 12:13 PM   #1 (permalink)
NamePros Regular
 
omegapandor's Avatar
 
Join Date: May 2008
Posts: 240
611.95 NP$ (Donate)

omegapandor will become famous soon enoughomegapandor will become famous soon enough


Help! Google Maps API simple things. . .need help

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.
__________________
Are you tired of viruses and popups? Use Firefox!

Last edited by omegapandor; 07-08-2008 at 12:26 PM.
omegapandor is offline  
Old 07-09-2008, 07:27 PM   #2 (permalink)
DNOA Member
 
mholt's Avatar
 
Join Date: May 2004
Location: Utah
Posts: 5,041
18.01 NP$ (Donate)

mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future

Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
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/doc...tion/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-go...calculator.htm

Good luck!
__________________
codeboards

A high-quality community of programmers -- Join today and post! We want new members!
mholt is offline  
Old 07-09-2008, 08:17 PM   #3 (permalink)
NamePros Regular
 
omegapandor's Avatar
 
Join Date: May 2008
Posts: 240
611.95 NP$ (Donate)

omegapandor will become famous soon enoughomegapandor will become famous soon enough


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!
__________________
Are you tired of viruses and popups? Use Firefox!
omegapandor is offline  
Old 07-09-2008, 08:33 PM   #4 (permalink)
DNOA Member
 
mholt's Avatar
 
Join Date: May 2004
Location: Utah
Posts: 5,041
18.01 NP$ (Donate)

mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future

Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
Quote:
Originally Posted by omegapandor
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:

Quote:
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
__________________
codeboards

A high-quality community of programmers -- Join today and post! We want new members!
mholt is offline  
Old 07-09-2008, 09:52 PM   #5 (permalink)
NamePros Regular
 
omegapandor's Avatar
 
Join Date: May 2008
Posts: 240
611.95 NP$ (Donate)

omegapandor will become famous soon enoughomegapandor will become famous soon enough


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.


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.
__________________
Are you tired of viruses and popups? Use Firefox!
omegapandor is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 04:54 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85