Yandex地图:如何将样式placemark从api 1.0更改为2.0

Yandex地图:如何将样式placemark从api 1.0更改为2.0,yandex,yandex-api,yandex-maps,Yandex,Yandex Api,Yandex Maps,我在api 1.0中有这种样式 var s = new YMaps.Style(); s.iconStyle = new YMaps.IconStyle(); s.iconStyle.offset = new YMaps.Point(-1, -30); s.iconStyle.href = "http:www.example.com/images/1.png"; s.iconStyle.size = new YMaps.Point(29, 28); s.iconStyle.shadow = ne

我在api 1.0中有这种样式

var s = new YMaps.Style();
s.iconStyle = new YMaps.IconStyle();
s.iconStyle.offset = new YMaps.Point(-1, -30);
s.iconStyle.href = "http:www.example.com/images/1.png";
s.iconStyle.size = new YMaps.Point(29, 28);
s.iconStyle.shadow = new YMaps.IconShadowStyle();
s.iconStyle.shadow.offset = new YMaps.Point(2, -12);
s.iconStyle.shadow.href = "http:www.example.com/images/2.png";
s.iconStyle.shadow.size = new YMaps.Point(29, 7);
在这里,我将此样式添加到placemark

var placemark = new YMaps.Placemark(new YMaps.GeoPoint(lat, long),
                            {hasBalloon: false,
                              style: s
                            });
                          placemark.setHintContent(mystring);
                          placemark.enableHint();
                          map.addOverlay(placemark);
如何在api 2.0中创建此样式?

我这样解决:

placemark.options.set('iconImageHref', 'http:www.example.com/images/1.png');
                placemark.options.set('iconImageOffset', [-1, -30]);
                placemark.options.set('iconImageSize', [28,29]);
placemark.options.set('iconShadowImageHref', 'http:www.example.com/images/2.png');
                placemark.options.set('iconShadowImageOffset', [2, -12]);
                placemark.options.set('iconShadowImageSize', [29, 7]);