Solved

Google Maps HREF on Hover Move View and Zoom

Posted on 2010-09-08
5
558 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

688 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