1

我正在尝试向这个 gmap 添加一个自定义标记;

$(function() {
    var addresspicker = $( "#addresspicker" ).addresspicker();
    var addresspickerMap = $( "#addresspicker_map" ).addresspicker(
    {
        regionBias: "au",
        map:      "#map_canvas",
        typeaheaddelay: 1000,
        mapOptions: {
            zoom:16,
            center: new google.maps.LatLng(-33.8674869, 151.2069902)
        }

    });

    addresspickerMap.on("addressChanged", function(evt, address) {
       console.dir(address);
    });
    addresspickerMap.on("positionChanged", function(evt, markerPosition) {
        markerPosition.getAddress( function(address) {
            if (address) {
                $( "#addresspicker_map").val(address.formatted_address);
            }
        })
    });
});

标记是这样的:

http://oursite.com.au/includes/helper/images/422marker.png

宽度:33 像素 x 50 像素

我认为这很简单:

marker: 'http://oursite.com.au/includes/helper/images/422marker.png',

但这没有用......请有任何想法

4

1 回答 1

1

标记将由 返回addresspickerMap.addresspicker( "marker"),您可以使用标记的 setIcon 方法应用自定义图标:

addresspickerMap.addresspicker( "marker")
  .setIcon('http://oursite.com.au/includes/helper/images/422marker.png');
于 2012-12-24T03:18:39.813 回答