The GeoChart zoomOut button is not visible at this time

I am currently exploring the geochart API, which is a relatively new one with limited information available.

<!DOCTYPE html>
<html>
  <head>
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
    <script type="text/javascript">
      google.charts.load('current', {
        'packages': ['geochart'],
        'mapsApiKey': 'AIzaSyD-9tSrke72PouQMnMX-a7eZSW0jkFMBWY'
      });
      google.charts.setOnLoadCallback(drawRegionsMap);

      function drawRegionsMap() {
        var data = google.visualization.arrayToDataTable([
          ['Country', 'Popularity'],
          ['Germany', 200],
          ['United States', 300],
          ['Brazil', 400],
          ['Canada', 500],
          ['France', 600],
          ['Russia', 700]
          //['RU', 700]
        ]);

        var options = {
          backgroundColor: '#81d4fa',
          showZoomOut: true,
        };
        console.log("showZoomOut=" + options.showZoomOut);
        var chart = new google.visualization.GeoChart(document.getElementById('regions_div'));
        google.visualization.events.addListener(chart, "zoomOut", function(){
          options.region = "world";
          console.log(options.region);
          chart.draw(data, options);        
        });

        google.visualization.events.addListener(chart, 'regionClick', function(r) {
          console.log(r);
          options.region = r.region;
          chart.draw(data, options);
        });
        chart.draw(data, options);
      }
    </script>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <title></title>
  </head>
  <body>
    <div id="regions_div" style="width; 900px; height: 500px;"></div>
  </body>
</html>

Although the showZoomOut option is set to true, the zoomButton is not being displayed as expected. You can find more details in the documentation here.

Screenshot link here I anticipate the display of the zoomButton similar to this image.

Answer №1

I have found the solution to this query on my own.

The zoomButton feature is only compatible with geomap, and cannot be utilized with GeoChart.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Ensuring draggable div remains fixed while scrolling through the page

I am currently working on creating a draggable menu for my website. The menu is functional and can be moved around the page as intended. However, I have encountered an issue where the menu disappears when scrolling down the page due to its position attrib ...

No shadows are visible when using a collada model on a MeshPhongMaterial surface with a spotlight illuminating the scene

I have been trying to solve this issue for a long time but have been unsuccessful. I am attempting to add shadows to my .dea model using MeshPhongMaterial, but the shadows are not appearing. The camera is in the correct position, the ground is made of Mes ...

Can you conceal a JavaScript function within a specific scope?

Suppose I have two functions a and b that I want to keep within a certain functional scope. Since they share some common code, I decide to extract this shared functionality into another method named support. support should be accessible by both a and b, b ...

Issue with fullcalendar: difficulty displaying events using ajax after clicking 'previous' or 'next' button

I am currently working on creating a calendar using fullcalendar. To retrieve data for the month, I make an external ajax request. Here are the key variables I utilize to render the fullcalendar: eventsJsonArray - used to load all events for the month ...

Is it possible to integrate vanilla JavaScript (non-JQuery) into my Angular application?

As a newcomer to Angular, I've heard that it's best to forget about jQuery when developing an Angular application. Unlike designing a page first and then making it dynamic with jQuery, in Angular you build the app from scratch which can lead to c ...

Calculating the angle between two planes in Three.js is a useful technique

I'm currently developing a project with the three.js library, and I am curious about how to calculate the angle (let's refer to it as α) between two plane geometries. You can find a helpful visual representation of the planes in this image. ...

When can you determine if all the ajax requests in a JQuery each loop have finished?

Within my JQuery each loop, I am triggering multiple ajax requests and looking to display a success message once all calls have been completed. Here is my code snippet: $('.container input:checked').each(function() { json_data = $(this).paren ...

Is there a way to retrieve the index and specific object that was modified using $watch in Angular?

I am receiving an array of objects from an API that is being updated every 2 seconds. I have a $watch function that is monitoring any changes in this array. I want to be able to identify which elements have changed along with their index, so that I can dyn ...

Ways to incorporate React.js into HTML for showcasing a portfolio

Having difficulties rendering my code using React.js for my portfolio. I am attempting to showcase my projects with images and p tags containing project titles and my role. Additionally, I would like the React elements to be clickable, directing users to t ...

Could we filter and retrieve only one unique notificationType/postId combination?

I have a notification model with the following Schema definition: const NotificationSchema = new Schema({ type: { type: String, required: true }, createdAt: { type: Number, required: true }, postId: { type: Schema.Types.Objec ...

I have exhausted all options trying to filter a 2D array in JavaScript

The 2D array provided is formatted as follows : [[ONE,1],[QUARTER,0.25],[QUARTER,0.25]] The desired output should be : [[ONE,1],[QUARTER,0.5]] An attempt was made using array.IndexOf but did not yield the expected result ONE,1,QUARTER,0.25,QUARTER,0.2 ...

collecting JavaScript objects directed to console.log

I attempted capturing the JavaScript console log using the method mentioned here on Stack Overflow. However, I am facing difficulty in retrieving the object along with a text message. Below is the code snippet that I have been working with: var obj={resul ...

What is the best way to implement a dropdown in MUI and React that displays functional components as items?

Here is a list of dummy components: const OwnerList = () => { return ( <Box sx={{ display: 'flex', }} className="owner-container" > <Avatar src='https://hips.hearstapps.com/hmg- ...

How can you resize a circle in Three.js without resizing its outline?

I'm currently using a THREE.Path to generate a Circular path and then utilizing a TubeGeometry to form a circle with transparent fill and an adjustable stroke thickness. My main query revolves around the process of scaling up the Circular path dynamic ...

Switch background color multiple times on click using JavaScript loop

Hello amazing people! I have a container with 52 small boxes and one large box containing a letter. The smaller boxes are arranged around the larger one using CSS grid, and when hovered over, they turn light grey. My Objective When any of the 52 small b ...

Unexpected behavior in jQuery AJAX: No alerts triggered on either success or failure in $.ajax and $.get

I have been experimenting with jQuery AJAX and my loadTable.php file, which generates a JSON output. However, I am facing issues with making $.ajax or $.get functions work. Even when I include alert functions in both success and failure scenarios, nothin ...

Using AngularJS to iterate through JSON data

I received JSON data from my Facebook account and saved it in a file called facebook.json. Next step is to retrieve and process the data from the JSON file in my controller. app.controller('Ctrl', function($scope, $http) { $http({metho ...

Quickly Share Documents within a Folder

I currently have a server set up with the following file structure: - index.js /client -index.html -about.html -signup.html -style.css Within the index.js file, I have implemented an express server. When the user navigates to /, it should display the ...

Verification Select Button Element

I am working on a Rails project and have implemented radio_button_tag. How can I add a validation to ensure that an option is chosen before submitting the form? <% @votes.each do |vote| %> <%= radio_button_tag "choice", "#{vote.id}" %> < ...

Addressing Memory Leakage Issues in a Basic Node.js Application

Out of sheer curiosity and as an experiment with NodeJS, I decided to write a basic program to test the Collatz Conjecture for an incredibly high number of integers. While this concept should work fine in theory, my simple code is unexpectedly facing a mem ...