-1

I've got this Google Map (works on my website, can't get it to work in jsfiddle?)

jsfiddle.net/9ZcwX/1/

I want to use an infobubble instead of the infowindow because I cant style the infowindow at all with css it seems. Everytime I try to add a new infobubble it just crashes the map. Not having much luck with existing questions.

K K
  • 17,794
  • 4
  • 30
  • 39
Sam
  • 185
  • 1
  • 3
  • 16

1 Answers1

0

Well, there were following issues in your fiddle:

  • You didn't included google maps javascript file.
  • You didn't provided the dimension to the map container which is important for rendering of map.
  • You place the DomListener code before the init code and it was executing before the html was loaded and hence the code failed to find the div with the given ID

Your code works fine after the modifications.

Here is the demo : http://jsfiddle.net/lotusgodkk/x8dSP/3605/

I didn't modified anything except reodering the code. I placed this code: google.maps.event.addDomListener(window, 'load', init);

at the end instead of the beginning and added the necessary javascript file.

And added the following CSS:

#map_canvas {
     height: 500px;
     width: 500px;
}
K K
  • 17,794
  • 4
  • 30
  • 39
  • Thanks heaps K K, do you know what I have to do to swap out the infowindow for a css editable infobubble? Or how to css the infowindow? – Sam Jul 07 '14 at 07:01
  • Yes, you can style the infowindow. Refer the solution on this post: http://stackoverflow.com/questions/7616666/google-maps-api-v3-custom-styles-for-infowindow . Should be easy to implement. I think this answer will help you: http://stackoverflow.com/a/7628522/2000051 – K K Jul 07 '14 at 07:05
  • Got it, I looked at that before and had no luck, instead of trying to make my code work with the parts I wanted from that example, I just took my location and styles accross to the one that worked. Cheers! – Sam Jul 07 '14 at 07:26