Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Google Maps Pins in wrong place (and move)

Posted on 2014-03-06
2
Medium Priority
?
205 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 2000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

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'…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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…

715 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