"google.maps.MarkerImage" deprecated

11,108 views
Skip to first unread message

Pil

unread,
Dec 4, 2012, 8:04:31 AM12/4/12
to Google Maps JavaScript API v3
The reference

https://developers.google.com/maps/documentation/javascript/reference#Icon

states that google.maps.MarkerImage class "is deprecated in favor of
Icon."

I'd searched a long time to find the right syntax for a marker icon
without using MarkerImage. I'm sorry but I didn't find any example.

Barry Hunter

unread,
Dec 4, 2012, 8:33:11 AM12/4/12
to google-maps-js-api-v3
Its just an object specification, not an actual class. So can just do something like


          var marker = new google.maps.Marker({
              position: myLatLng,
              map: map,
              icon: {
                  url: '/path/to/icon.png',
                  size: new google.maps.Size(10,10)
              }
          });



--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.


Pil

unread,
Dec 4, 2012, 10:23:47 AM12/4/12
to Google Maps JavaScript API v3
Ahh, thanks Barry. Looks good.


On Dec 4, 2:33 pm, Barry Hunter <barrybhun...@gmail.com> wrote:
> Its just an object specification, not an actual class. So can just do
> something like
>
>           var marker = new google.maps.Marker({
>               position: myLatLng,
>               map: map,
>               icon: {
>                   url: '/path/to/icon.png',
>                   size: new google.maps.Size(10,10)
>               }
>           });
>
>
>
>
>
>
>
> On Tue, Dec 4, 2012 at 1:04 PM, Pil <wolf...@gmail.com> wrote:
> > The reference
>
> >https://developers.google.com/maps/documentation/javascript/reference...
Reply all
Reply to author
Forward
0 new messages