javascript - Custom google maps marker from sprite and retina proof -
I have learned that when I want to use sprites as Google Map markers, I have to keep it like this :
var myIcon = new google.maps.MarkerImage ("../public/img/categories.png", new google.maps.size (90, 50), new google.maps .Point (0, data [i] .subcategory_id * 50); // Like I understand: // new google.maps.MarkerImage (url, original size, anchor point); When creating this retina-proof, I understand that I have to make it this way:
// new google.maps.MarkerImage (url, original size, anchor point, null, half size); var myIcon = new google.maps.MarkerImage ("../public/img/categories.png", new google.maps.size (90,50), new google.maps.Point (0, data [i] .subcategory_id * 50), blank, new google.maps.size (45,25); However, when adding additional size, my marker no longer exists. What am i doing wrong As such, @ Duncan said, "I have to use the icon square."
var myIcon {url: "../public/img/categories.png", size: new google.maps.size (45,25), // this size should be on the map Scale size: The new google.maps.size (45,550), // The normal size of the image is 90x1100 because the retina demands dual-size origin: new google.maps.Point (0, 25) // status in the phantom}; This helped me, thank you!
Comments
Post a Comment