Solved

Google Maps HREF on Hover Move View and Zoom

Posted on 2010-09-08
5
543 Views
Last Modified: 2012-05-10
Hi,

I have a website with international distributors on it - There are distributors all around the world, what I would like to do is:

1) Create a HREF Text link, as people hover over the link, it moves the view and zoom of the map to that country. The problem I have right now is that the worldwide map is so far out in zoom, that some distributors are hiding others - By zoomng in on hover of the country text link href, it should show the 2 markers closer up at a country level zoom remedying this problem.

Thanks!
0
Comment
Question by:intangiblemedia
  • 2
  • 2
5 Comments
 
LVL 4

Expert Comment

by:senthilkumarsb
ID: 33626760
the below link will help you more... Here every thing explained clearly.

http://n01se.net/gmapez/start.html
0
 
LVL 18

Expert Comment

by:Matthew Kelly
ID: 33632665
Attached is a working example of mouseover zoom in and pop up.

I set the zoom to 7, but you can change that in the "mymouseover" function.

You can remove the mouseout function if you don't want it.
test.html
0
 

Author Comment

by:intangiblemedia
ID: 33634174
Thanks Mathew,

If I click the link, will it stay on that marker?
0
 
LVL 18

Accepted Solution

by:
Matthew Kelly earned 500 total points
ID: 33642100
The attached is an example of where the click saves the position. It is done by added a variable to save the last clicked location and adding an onclick event.

If you want it to go back to the last clicked location instead of the center onmouseout change:

map.setCenter(new GLatLng( 9.1088986592431382, -56.6015625), 2);

To:

GEvent.trigger(gmarkers[clickedMarker], "click");
var point = gmarkers[clickedMarker].getLatLng();
map.setCenter(point,7);
test.html
0
 

Author Closing Comment

by:intangiblemedia
ID: 33816932
Thanks Matthew
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
HTML and CSS for a complex page 20 57
Download a website to hdd 2 47
jQuery not working on ELSE... why? 2 19
Bad <form> statement? 9 20
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

939 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now