Solved

Google Maps Pins in wrong place (and move)

Posted on 2014-03-06
2
195 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

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
Sending E-mail ASP.Net 3 55
Google script to get long/lat from address 10 63
Angular - ng-if worked but why like this? 5 31
Javascript create file issue 4 45
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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.
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…

947 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

22 Experts available now in Live!

Get 1:1 Help Now