Solved

Google Maps Pins in wrong place (and move)

Posted on 2014-03-06
2
194 Views
Last Modified: 2014-03-06
Hello,

I have this page, which is simply bizarre:

http://www.villasdirect.com/top-destinations.asp?Country=France&property-type=rentals

The pins are supposed to be in France, and when you move your mouse over the names on the left, they do move into their correct position, but not when the page loads...

I have attached the code for the page - help appreciated!

Thanks in advance ;-)
map.txt
0
Comment
Question by:Nico2011
2 Comments
 
LVL 22

Accepted Solution

by:
Snarf0001 earned 500 total points
ID: 39909850
Go to your PlaceMarkers function.

When you create the marker, you're setting the "icon" to the "MarkerImage" you just made.
MarkerImage has been deprecated and was glitchy to begin with.
It's being fixed on the hover, because the mouseover / mouseout commands are then just calling .setIcon with the image url, instead of the MarkerImage object.

in var marker = new google.maps.Marker(.....
replace icon:img with icon:imgnam and it should work properly.

Couple other things if you're cleaning up...
1) A few lines above that you're adding an event listener for a marker variable that hasn't been declare yet.
2) You're missing the end head tag and the beginning body tag.
3) You're loading the google maps api twice, once in the head and once underneath the map
4) You're loading three different versions of jquery at various points in the page.
0
 

Author Closing Comment

by:Nico2011
ID: 39909888
Thank you sooo much - works perfectly!

I will fix the other errors when I get a moment too...
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…

743 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

12 Experts available now in Live!

Get 1:1 Help Now