Solved

Google Maps HREF on Hover Move View and Zoom

Posted on 2010-09-08
5
546 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

803 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