Solved

Google Maps HREF on Hover Move View and Zoom

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
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 videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

762 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

19 Experts available now in Live!

Get 1:1 Help Now