27.10.2014 Views

Google Maps API 3

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 6 ■ MARKER ICONS<br />

Figure 6-17. A sprite being used as a marker icon<br />

If you change the origin parameter to a square that starts at 65 pixels from the left, you will get the<br />

right-most icon instead (Figure 6-18).<br />

var image = new google.maps.MarkerImage(<br />

'img/markers.png',<br />

new google.maps.Size(32, 37), // The Size<br />

new google.maps.Point(65, 0), // The origin<br />

new google.maps.Point(16, 35) // The anchor<br />

);<br />

113

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!