Wednesday, July 24, 2013

Google Maps Styled & Visualization GeoCharts

I made a styled google map and I want to use some visualization Geocharts. Can I use both simultaniously?

      html, body, #map-canvas {     margin: 0;     padding: 0;     height: 100%;   }   </style> <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> <script> 

var map; var mateo = new google.maps.LatLng(37.53, -122.343);

var MY_MAPTYPE_ID = 'custom_style';

function initialize() {

var featureOpts = [...MY STYLE...];  var mapOptions = {     zoom: 10,     center: mateo,     mapTypeControlOptions: {       mapTypeIds: [google.maps.MapTypeId.ROADMAP, MY_MAPTYPE_ID]     },     mapTypeId: MY_MAPTYPE_ID   };    map = new google.maps.Map(document.getElementById('map-canvas'),       mapOptions);    var styledMapOptions = {     name: 'Custom Style'   };    var customMapType = new google.maps.StyledMapType(featureOpts, styledMapOptions);    map.mapTypes.set(MY_MAPTYPE_ID, customMapType); }  google.maps.event.addDomListener(window, 'load', initialize); 

Now, I also want to use Visualization, GeoCharts

<html>   <head>     <script type='text/javascript' src='https://www.google.com/jsapi'></script>     <script type='text/javascript'>      google.load('visualization', '1', {'packages': ['geochart']});      google.setOnLoadCallback(drawRegionsMap);        function drawRegionsMap() {         var data = google.visualization.arrayToDataTable([           ['Country', 'Popularity'],           ['Germany', 200],           ['United States', 300],           ['Brazil', 400],           ['Canada', 500],           ['France', 600],           ['RU', 700]         ]);          var options = {};          var chart = new google.visualization.GeoChart(document.getElementById('chart_div'));         chart.draw(data, options);     };     </script>   </head>   <body>     <div id="chart_div" style="width: 900px; height: 500px;"></div>   </body> </html> 

Thanks,

I would ideally like to have my map style and another style setting for all the selected countries. Thanks

Source: http://stackoverflow.com/questions/17797043/google-maps-styled-visualization-geocharts

Chicago teachers strike september 11 2001 september 11 2001 blake lively Espn Fantasy Football Grandparents Day 2012 army wives

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.