Abhinav
Abhinav

Reputation: 89

text is not showing on label on google map marker

The problem is very simple , everything is working fine , the only problem is:
Markers and labels are showing on google map but label text is not showing , here is my complete code : http://jsfiddle.net/abhbha/cd4h3yyo/3/

function initialize(lat1, long1) {
    var markers = [
    {
            "propid": "117",
            "title": " Title 1 ",
            "lat": "28.683441130339858000",
            "lng": "77.316357372033620000",
           },
            {
                "propid": "116",
                "title": " Title 2",
                "lat": "28.905853091546845000",
                "lng": "78.470265147912530000"
            },
            {
                "propid": "115",
                "title": " Title 3",
                "lat": "28.986857208298716000",
                "lng": "77.712208507287530000",
            }];

    var mapOptions = {
        center: new google.maps.LatLng(lat1, long1),
        zoom: 12,
        mapTypeId: google.maps.MapTypeId.ROADMAP,
    };
    var infoWindow = new google.maps.InfoWindow();
    var map = new google.maps.Map(document.getElementById("gmap"), mapOptions);
    for (i = 0; i < markers.length; i++) {
        var data = markers[i]
        var myLatlng = new google.maps.LatLng(data.lat, data.lng);
        var marker = new MarkerWithLabel({
            position: myLatlng,
            map: map,
            //icon: '/img/sticker/empty.png',
            //shadow: '/img/sticker/bubble_shadow.png',
            //transparent: '/img/sticker/bubble_transparent.png',
            title: data.title,
            labelContent: " jhdgfjdgh ",
            labelClass: "labels",
            labelVisible: true,
            labelInBackground: false,
        });
    }
}

Upvotes: 0

Views: 1680

Answers (1)

Dr.Molle
Dr.Molle

Reputation: 117354

as it seems you've loaded an outdated version of markerwithlabel.js,
load http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerwithlabel/src/markerwithlabel.js instead:

http://jsfiddle.net/wxtmjstw/

Upvotes: 2

Related Questions