Google Maps and Me...

Please spread the word if you like this content!
Digg Button submit to reddit
 

Greetings.

I’ve been messing around with the Google Maps API v.3 for a client of mine.  I figure I would share my initial findings:

main_screen

The “app” is ASP.NET 3.5, but really it’s a bunch of auto-generated JavaScript.  The big map layout has a good 100+ markers placed designating various Acme Distribution Centers (I had just watched some Looney Tunes…).  When you select a state from the dropdown, the map will center and zoom in on that state, and the Acme Distribution Centers for that state will be listed on the right (actually the google.maps.Geocoder JSON result is displayed for each marker in the state selected; I’ll do the address later :)  ):

main_screen_2

Clicking a marker zooms in on that marker in google.maps.MapTypeId.HYBRID display mode, and puts the google.maps.Geocoder JSON result on the bottom:

main_screen_3

You can get the project here.  As I said eariler, it’s 99% auto-generated JavaScript with a little ASP.NET on top.  Here’s a dump of the generated JavaScript.

I won’t lie to you: I’m really not sure I’m using the API properly, yet.  In particular, I created an array of objects that associates a google.maps.Marker instance with a hash of the name of the state it’s in.  Then when you select a state in the dropdown, the option’s value – the hash of the state’s name - is used to select those google.maps.Markers from that array that “reside” in that state.  I’m sure the API has a built-in way of handling this, but like I said, this is my first stab at this.

Before you think I broke something or whatever, I’ve purposely “fixed” the map and made it so it does not zoom with the mouse wheel.  This is easy to change.  Just look for where I’m setting the MapOptions when creating the google.maps.Map object.

Have fun with the code.  The online documentation is good, as are the code samples.  I’ll keep posting as I garner new aspects of the API.  And please comment for other users if you have suggestions, et al.

~ZagNut

posted @ Saturday, September 04, 2010 10:08 PM

Print

Comments on this entry:

# re: Google Maps and Me...

Left by moonshine at 2/2/2012 11:16 AM
Gravatar
statue of zeus at olympia The seven World Wonders list of the ancient times was initially recorded approximately in the 2nd century BC. 

# re: Google Maps and Me...

Left by world wonders at 2/2/2012 11:17 AM
Gravatar
The seven World Wonders list of the ancient times was initially recorded approximately in the 2nd century BC. 

Your comment:



 (will not be displayed)


 
 
 
Please add 6 and 4 and type the answer here:
 

Live Comment Preview:

 
«February»
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910