Google Maps API v3 Store Locator

289 views
Skip to first unread message

cartch

unread,
Jul 7, 2010, 1:25:19 PM7/7/10
to Google Maps JavaScript API v3
Looking to add a sidebar to this example:

http://code.google.com/apis/maps/articles/phpsqlsearch_v3.html


Like the did in the V2 example:

http://code.google.com/apis/maps/articles/phpsqlsearch.html


Any help would be appreciated

blaines.insane

unread,
Jul 7, 2010, 8:20:24 PM7/7/10
to Google Maps JavaScript API v3
I'm looking to do the same thing, just haven't gotten around to it
yet, or I'd tell you how exactly. But basically, I think all you need
to do is set up the div where you want the feedback, give it an ID
(let's call it "sidebar"), then, in the createMarker function, after
the "html" var is set up, change the innerHTML of that div to the
value of that html var:

createMarker():
...
var html = "<p><span style='font-weight:bold'>" + name + "</span><br/
>" + address1 + "<br />" + address2 + cityStateZip + "<br /></
p><p><span style='font-weight:bold'>" + phone + "</span></p>"; // info
window contents

// add this line after the html var declaration:
document.getElementById("sidebar").innerHTML=html;

var marker = new google.maps.Marker({
map: map,
...

Although, those markers are created in a loop, so you would probably
want to declare a global variable, store the HTML markup in that
variable (appending to it in each itteration), then change the
innerHTML all at once. Otherwise, you'd only see the details for the
last marker created. Maybe more like:

//global var
var sidebarInfo;

//in createMarker() add this line after the html var declaration:
sidebarInfo+=html;

//Then at the end of the downloadUrl() function, change out the
innerHTML:
document.getElementById("sidebar").innerHTML=sidebarInfo;

Of course, I could be all wrong... I'm a javascript noob. So follow at
your own risk.

tinem

unread,
Jul 8, 2010, 12:52:57 AM7/8/10
to Google Maps JavaScript API v3, ti...@email.dk
I would also like to see a working example of this code
http://code.google.com/intl/da/apis/maps/articles/phpsqlsearch_v3.html
instead of just an image. Someone know where this example is to test,
please?

tinem

unread,
Aug 8, 2010, 8:00:14 AM8/8/10
to Google Maps JavaScript API v3
On 8 Jul., 06:52, tinem <ti...@email.dk> wrote:
> I would also like to see a working example of this codehttp://code.google.com/intl/da/apis/maps/articles/phpsqlsearch_v3.html
> instead of just an image. Someone know where this example is to test,
> please?

NO ONE have a working example to show just as the tutorial explain to
do it, please?

Federico Ulfo

unread,
Aug 8, 2010, 8:50:03 AM8/8/10
to google-map...@googlegroups.com
Hi Tinem,
I've an example for the use of api v3 client side here: www.federicoulfo.it/tuscany.html (front-end) and www.federicoulfo.it/tuscany_admin.html (back-end)
server side you need to create a database (mysql is ok) and to read / write from it (php is ok)

Cheers

2010/8/8 tinem <ti...@email.dk>

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.


tinem

unread,
Aug 8, 2010, 10:32:53 AM8/8/10
to Google Maps JavaScript API v3
None of your links is functioning. :-(

Eddie LaRue

unread,
Aug 8, 2010, 10:51:30 PM8/8/10
to Google Maps JavaScript API v3


On Aug 8, 7:32 am, tinem <ti...@email.dk> wrote:
> None of your links is functioning. :-(I have a working page at www.celltreesinc.com. It is based on the tutorials, but has had other things added. Just go to the maps page.

tinem

unread,
Aug 9, 2010, 1:01:51 AM8/9/10
to Google Maps JavaScript API v3
Can't get this site to functioning either.

NO ONE just have an example of the tutorial?

I have made a version with the tutorial for v2 as you can see here
http://www.findbiblioteket.dk/radius/ - just type zipcode 2800 for
instance. And a lot of other sites but NOT for v3.


Rossko

unread,
Aug 9, 2010, 4:50:47 AM8/9/10
to Google Maps JavaScript API v3
> NO ONE just have an example of the tutorial?

You may be the first to want it ; people will help you if you run into
trouble converting from the v2 version.
Reply all
Reply to author
Forward
0 new messages