Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to display all counties of England of united kingdom in google geo chart. Can anyone please help me out.

What I have tried:

<!DOCTYPE html>
<html>
  <head>
    <title>Showing pixel and tile coordinates</title>
    <meta name="viewport" content="initial-scale=1.0">
    <meta charset="utf-8">
    <style>
      /* Always set the map height explicitly to define the size of the div
       * element that contains the map. */
      #map {
        height: 100%;
      }
      /* Optional: Makes the sample page fill the window. */
      html, body {
        height: 100%;
        margin: 0;
        padding: 0;
      }
    </style>
	<script type="text/javascript" src="https://www.google.com/jsapi"></script>
  </head>
  <body>
    <div id="visualization" style="margin: 1em"> </div>
    <script>
      google.load('visualization', '1', { 'packages': ['geochart'] });
    google.setOnLoadCallback(drawMap);

    function drawMap() {
        var data = google.visualization.arrayToDataTable([
    ['Country', 'Site', 'Counts'],
    ['England', 0, 10],
	['Scotland', 1, 20]
    ]);

        var options = {width: '90%', height: '1000'};
		options['zoom']= '20';
        options['region'] = 'GB';
		options['displayMode']='regions';
        options['resolution'] = 'provinces';
        options['colors'] = ['#0e9a0e', '#fadc41', '#d74a12'];
        options['legend'] = 'none';
         

        var container = document.getElementById('visualization');
        var geochart = new google.visualization.GeoChart(container);
        geochart.draw(data, options);
    };
    </script>
	 
    <script async defer
    src="https://maps.googleapis.com/maps/api/js?key=AIzaSyD-9tSrke72PouQMnMX-a7eZSW0jkFMBWY&callback=initMap">
    </script>
	
	
  </body>
</html>
Posted
Updated 10-Jul-18 23:36pm
v2
Comments
CHill60 11-Jul-18 9:01am    
What is wrong with the code you have?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900