Hello to all, welcome to therichpost.com. Today In this post, I will show, How to show Google Map for particular Country with selected Provinces?
If you new in Google map or you want know more about it then you can check my posts related to Google Maps.
This post is very interesting and I am hoping, you will all like this also very much.
Here is the working code and you can add this into your html file:
<html> <head> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script type="text/javascript"> google.charts.load('current', { 'packages':['geomap'], // Note: you will need to get a mapsApiKey for your project. // See: https://developers.google.com/chart/interactive/docs/basic_load_libs#load-settings 'mapsApiKey': 'AIzaSyD-9tSrke72PouQMnMX-a7eZSW0jkFMBWY' }); google.charts.setOnLoadCallback(drawRegionsMap); function drawRegionsMap() { var data = google.visualization.arrayToDataTable([ ['Regions', 'Popularity'], ['New York', 200], ['Texas', 500], ['California', 600] ]); var options = {}; options['region'] = 'US'; options['resolution'] = 'provinces'; var chart = new google.visualization.GeoChart(document.getElementById('regions_div')); chart.draw(data, options); } </script> </head> <body> <div id="regions_div" style="width: 900px; height: 500px;"></div> </body> </html>
If you have any query or you want more advance code related to this, then you can comment below or ask question.
Thank you,
Harjas,
TheRichPost
Hi, Can we use this in Angular?
yes we can
Thank you for this post.
Your most welcome
Hi. How about Malaysian cities? Can we add? Because I couldn’t find the city code.
May be with help of lat long.
how to incorporate this in angular
Yes I have example on this.
plz share, as i’m stuck over this for several hours
plz share…as I’m stuck over this for several hours
plz share, as i’m stuck over this for several hours
Please search via blog search, thanks.
please provide a link
Please share the link, i’m unable to find it.
please share the link as i’m unable to find it