close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Centering Map

Thread began 12/17/2010 6:54 am by tops367539 | Last modified 12/17/2010 12:38 pm by Jason Byrnes | 1154 views | 6 replies |

tops367539

Centering Map

I have a database with several historical sites, all with their Latitude and Longitude. The user searches for his site and clicks on it. I then search the database for all the other sites within 5 miles. I load a page showing all of the sites on the GoogleMap, however it is centred on the first site in the Dataset. How do I centre the map on the site that the user clicked?

Sign in to reply to this post

Jason ByrnesWebAssist

see the "How to change which address your map centers on" Tutorial in the how to section of the pro maps support page:
pro-maps-for-google/

Sign in to reply to this post

tops367539

Centering Maps

Thank you Jason, but that applies to Addresses. Many of the these historical sites have no addresses.

Anyway, I figured it out from the Google Maps sites and I did the following ant it seems to work.

In wagmp_map_1.php, find the following line at the end of the script

<?php } while ($row_DetailRS1 = mysql_fetch_assoc($DetailRS1)); ?>

Type in the following code after the above line

map.setZoom(12);
map.setCenter(new GLatLng(52.1188, -8.29158),12);

The 12 is the zoom level. I have to dynamically change the Lat and Lng yet, put the above does the trick for my testing.

Sign in to reply to this post

tops367539

Showing Bubble

Hi Jason

After I center the map on the desired location, the bubble shown still belongs to the first site in the Recordset, how can I open the bubble for a specific site. I have tried the following and it does not work

map.setZoom(12);
map.setCenter(new GLatLng(52.1188, -8.29158),12);
GEvent.trigger(map,'click',null,new GLatLng(52.1188, -8.29158));

Sign in to reply to this post

Jason ByrnesWebAssist

please send a link where i can see the page.

Sign in to reply to this post

tops367539

mY tEST sITE

Hi Jason

The test site is at sitelist.php

Click on 9 (Ballynoe Corrin) and again on the next page, I then show the map, with Ballynoe centered, but the bubble belongs to Rathcormack

Thank you

Sign in to reply to this post

Jason ByrnesWebAssist

you have not implemented the links like they are in the tutorial I linked you to.


please re read the tutorial.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...