Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Chacala_Nayarit

macrumors 6502
Original poster
Oct 6, 2005
315
0
Lakewood, Washington
I am doing this: link

I have having a bitch of a time with the JavaScript thingy.

What I want is to zone in on the address of the store, like on Google Maps front page.

Anybody know how to do this?
 
Not sure what you mean by "zone in", but if I may, I'd like to recommend a few things.

First, set a variable for a marker to where you are pointing, not just an info window:

Code:
var position = new GLatLng(47.171, -122.517);

Then, use a tabbed window for information. One tab for the address, another tab for a form to get directions from google maps:

Code:
var infoTabs = [
	  new GInfoWindowTab("Address", '<h2>Rainier Lighting and Electric Supply</h2><address>ADDRESS<br />CITY, STATE ZIP</address>'),
	  new GInfoWindowTab("Directions", '<form target="_blank" action="http://maps.google.com/maps" method="get"><fieldset><legend>Directions from Your Address</legend><input type="hidden" name="daddr" value="RAINIER SUPPLY ADDRESS" id="daddr" /><label for="saddr">Address:</label> <input type="text" name="saddr" value="" id="saddr" /><br /><input type="submit" name="submit" value="Get Directions" id="submit" /></fieldset></form>')
];

Then, tell GMaps to draw it:

Code:
var marker = new GMarker(position);
GEvent.addListener(marker, "click", function() {
 marker.openInfoWindowTabsHtml(infoTabs);
});
map.addOverlay(marker);
marker.openInfoWindowTabsHtml(infoTabs);
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.