Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8632719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:23:25+00:00 2026-06-12T09:23:25+00:00

I am using the Google Maps javascript API v3 with a project, and I

  • 0

I am using the Google Maps javascript API v3 with a project, and I am currently having troubles getting the maplabels to appear above the polygons. I know that the polygons are z-indexed with respect to only themselves (Not able to use the z-index of a maplabel to place the maplabel above it). I was wondering if there was some hack to get around this issue. I am also using the info Window library for the api, and I need the labels to appear above the polygons, but below the info window.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:23:26+00:00Added an answer on June 12, 2026 at 9:23 am

    NOTE: Fusion Tables was shut down on December 3, 2019, Google Maps Javascript API version 3.37 is the last version that supported Fusion Tables

    Are you trying to do something like this:

    http://www.geocodezip.com/geoxml3_test/v3_FusionTables_zipcode_map.html

    Uses infoBox for map labels which appear on top of the FusionTablesLayer Polygon.

    With a white background on the label:

    http://www.geocodezip.com/geoxml3_test/v3_FusionTables_zipcode_map_whiteBg.html

    screenshot of map

    code snippet:

    google.load('visualization', '1', {
      'packages': ['corechart', 'table', 'geomap']
    });
    var map;
    var labels = [];
    var layer;
    var tableid = 1499916;
    
    function initialize() {
      geocoder = new google.maps.Geocoder();
      map = new google.maps.Map(document.getElementById('map_canvas'), {
        center: new google.maps.LatLng(37.23032838760389, -118.65234375),
        zoom: 6,
        mapTypeId: google.maps.MapTypeId.ROADMAP
      });
    
      layer = new google.maps.FusionTablesLayer(tableid);
      layer.setQuery("SELECT 'geometry' FROM " + tableid);
      layer.setMap(map);
    
      codeAddress();
    
      google.maps.event.addListener(map, "bounds_changed", function() {
        displayZips();
      });
      google.maps.event.addListener(map, "zoom_changed", function() {
        if (map.getZoom() < 11) {
          for (var i = 0; i < labels.length; i++) {
            labels[i].setMap(null);
          }
        }
      });
    }
    
    function codeAddress() {
      var address = document.getElementById("address").value;
      geocoder.geocode({
        'address': address
      }, function(results, status) {
        if (status == google.maps.GeocoderStatus.OK) {
          map.setCenter(results[0].geometry.location);
          var marker = new google.maps.Marker({
            map: map,
            position: results[0].geometry.location
          });
          if (results[0].geometry.viewport)
            map.fitBounds(results[0].geometry.viewport);
        } else {
          alert("Geocode was not successful for the following reason: " + status);
        }
      });
    }
    
    function displayZips() {
      //set the query using the current bounds
      var queryStr = "SELECT geometry, ZIP, latitude, longitude FROM " + tableid + " WHERE ST_INTERSECTS(geometry, RECTANGLE(LATLNG" + map.getBounds().getSouthWest() + ",LATLNG" + map.getBounds().getNorthEast() + "))";
      var queryText = encodeURIComponent(queryStr);
      var query = new google.visualization.Query('https://www.google.com/fusiontables/gvizdata?tq=' + queryText);
    
      //set the callback function
      query.send(displayZipText);
    
    }
    
    
    var infowindow = new google.maps.InfoWindow();
    
    function displayZipText(response) {
      if (!response) {
        alert('no response');
        return;
      }
      if (response.isError()) {
        alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage());
        return;
      }
      if (map.getZoom() < 11) return;
      FTresponse = response;
      //for more information on the response object, see the documentation
      //http://code.google.com/apis/visualization/documentation/reference.html#QueryResponse
      numRows = response.getDataTable().getNumberOfRows();
      numCols = response.getDataTable().getNumberOfColumns();
      for (i = 0; i < numRows; i++) {
        var zip = response.getDataTable().getValue(i, 1);
        var zipStr = zip.toString()
        while (zipStr.length < 5) {
          zipStr = '0' + zipStr;
        }
        var point = new google.maps.LatLng(
          parseFloat(response.getDataTable().getValue(i, 2)),
          parseFloat(response.getDataTable().getValue(i, 3)));
        // bounds.extend(point);
        labels.push(new InfoBox({
          content: zipStr,
          boxStyle: {
            border: "1px solid black",
            textAlign: "center",
            backgroundColor: "white",
            fontSize: "8pt",
            width: "50px"
          },
          disableAutoPan: true,
          pixelOffset: new google.maps.Size(-25, 0),
          position: point,
          closeBoxURL: "",
          isHidden: false,
          enableEventPropagation: true
        }));
        labels[labels.length - 1].open(map);
      }
    }
    
    google.maps.event.addDomListener(window, 'load', initialize);
    #map_canvas {
      width: 610px;
      height: 400px;
    }
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript" src="https://maps.google.com/maps/api/js?key=AIzaSyCkUOdZ5y7hMm0yrcCQoCvLwzdM6M8s5qk"></script>
    <script type="text/javascript" src="https://cdn.rawgit.com/googlemaps/v3-utility-library/07f15d84/infobox/src/infobox.js"></script>
    <script type="text/javascript" src=https://cdn.rawgit.com/geocodezip/geoxml3/f43a77ca/polys/geoxml3.js"></script>
    <span class="style51"><span class="style49">Show</span>:</span>
    <input id="address" type="text" value="07646"></input>
    <input id="geocode" type="button" onclick="codeAddress();" value="Geocode" />
    <div id="map_canvas"></div>
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

using javascript google-maps api I currently have it setup to remove a maker I
I'm using the Google Maps javascript V3 API and I'm having problems with setting
I'm currently working on an ASP.NET project where I'm using the Google Maps API
Using the Google Maps JavaScript v3 API's editable polygons and/or drawing library, is it
I'm using Google Maps Javascript API V3 in my project. I want to move
I'm using Google Maps Javascript API V3 Places Library in order to add Places
I am using Google Maps API V2 (I know, but i am editing a
I'm using google.maps javascript API v3. I need to translate a set of civic
I am using Google maps JavaScript API. Here is code : <!DOCTYPE html PUBLIC
I'm familiar with using Google Maps Javascript API. Recently I started using MapKit framework

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.