Solved

Google Maps Pins in wrong place (and move)

Posted on 2014-03-06
2
199 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
[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 Comments
 
LVL 23

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
href return to normal window 5 29
window close link 7 33
Duplicate Elements with JS / jQuery 3 24
DataTable column sorting incorrectly 2 19
In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
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…
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…

749 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