0

i want to change the Colors for Markers/Pins on Google Map Chart, this is how i am doing it. I am unable to display any marker, with customize image/color.

<script>
        google.load("visualization", "1", {packages:["map"]});
        google.setOnLoadCallback(drawMap);
        function drawMap(dataArray) {
            var pinColor = "FE7569";
            var pinImage = new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|" + pinColor,
            new google.maps.Size(21, 34),
            new google.maps.Point(0,0),
            new google.maps.Point(10, 34));
            var pinShadow = new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_shadow",
            new google.maps.Size(40, 37),
            new google.maps.Point(0, 0),
            new google.maps.Point(12, 35));
            var data = google.visualization.arrayToDataTable(dataArray);
            var map = new google.visualization.Map(document.getElementById('map_div'));
            map.Marker({
                position: new google.maps.LatLng(0,0), 
                map: map,
                icon: pinImage,
                shadow: pinShadow
            });
            var options = {mapType: 'terrain',showTip: true,useMapTypeControl:true};

            map.draw(data,options);
        }
    </script>
noobie-php
  • 6,817
  • 15
  • 54
  • 101
  • I think [link](http://stackoverflow.com/questions/11064081/javascript-change-google-map-marker-color) and [link](http://stackoverflow.com/questions/7095574/google-maps-api-3-custom-marker-color-for-default-dot-marker) will help you a lot. – Ram Patidar Feb 13 '14 at 13:51
  • @RamPatidar: i already tried this link http://stackoverflow.com/questions/7095574/google-maps-api-3-custom-marker-color-for-default-dot-marker, that you suggested and most of my code is done with its help but still i cant figure out the problem – noobie-php Feb 13 '14 at 14:23
  • The Google Maps visualization for the Visualization API does not support most the Google Maps features, including modifying the markers. You have to use Google Maps directly (not through the Visualization API) if you want to use these features. – asgallant Feb 13 '14 at 18:03

1 Answers1

0

iconFileErr = 'http://maps.google.com/mapfiles/ms/icons/red-dot.png'; marker.setIcon(iconFileErr);

madhuka
  • 101
  • 4