开发者

Google Map V3.0 Using Custom Marker

Hi I am doing a project on Integration of google map v3.0. I finished the integration I am happy with the Output. The Problem is I was trying to change the RED Marker to Custom Marker. I have saved a marker in my solution. And was trying with this piece of code. The Program is running but i am not getting any marker on the map(either red mark开发者_如何学编程er or custom marker). I tried in many blogs but couldnot find a solution.

Please anyone Help me Out.

var icon = new google.maps.MarkerImage("icon55.png");
           var marker = new google.maps.Marker({
                    position: location,
                    map: map,
                    icon: icon
               });

Thank You


This is how I have been doing markers with customer icons:

var marker = new google.maps.Marker({
            position: latlng,
            map: theMap,
            title: title,
            icon: icon
        });

Here latlng is a google.maps.LatLng object, theMap is the google.maps.Map object, title is a string, icon is the url to the customer marker image.

Hope this helps.

Bob

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜