Saturday 26 March 2011

Links and Images on Gmap

You can include links and images in your info windows, and use most HTML formatting commands, as long as you follow a few simple rules:
  • Use different types of quotes in the HTML from those that you use in Javascript
    Like this '<a href="http://sharafjaffri.blogspot.com">'
    or like this "<a href='http://sharafjaffri.blogspot.com'>"
  • When using images, do specify the height and width, otherwise the size of the info window will be calculated incorrectly.'<img src="test.jpg" width=150 height=100>'
  • If loading the information from XML, replace '<' and '>' characters with '&lt;' and '&gt;'.
    '&lt;img src="image.jpg" width=150 height=100&gt;'
  • If you want to try writing code that passes W3C Validation, then you need to avoid having the characters "</" in your text. The officially correct way to write "</a>" is to insert a backslash before the forward slash, like "<\/a>".

No comments:

Post a Comment