Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google maps api 3 在邮政编码边界上显示自定义多边形_Google Maps Api 3 - Fatal编程技术网

Google maps api 3 在邮政编码边界上显示自定义多边形

Google maps api 3 在邮政编码边界上显示自定义多边形,google-maps-api-3,Google Maps Api 3,我想显示邮政编码边界,并在该边界上显示自定义多边形 这是我的密码 <!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta charset="utf-8"> <title>Fusion Tables styling</title> <style>

我想显示邮政编码边界,并在该边界上显示自定义多边形

这是我的密码

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Fusion Tables styling</title>
<style>
  html, body, #map-canvas {
    height: 100%;
    margin: 0px;
    padding: 0px
  }
</style>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script>
var map, layer;
var tableid = 2996349;
var triangleCoords = [
new google.maps.LatLng(37.2684,-119.956),
new google.maps.LatLng(37.5137,-119.958),
new google.maps.LatLng(37.417, -120.149),
new google.maps.LatLng(37.3957, -119.745)
];
 var bermudaTriangle;
function initialize() {

 var usa=new google.maps.LatLng(37.23032838760389, -118.65234375);

  map = new google.maps.Map(document.getElementById('map-canvas'), {
  center:usa,
  zoom: 4
});


bermudaTriangle = new google.maps.Polygon({
paths: triangleCoords,
strokeColor: '#FF0000',
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: 'blue',
fillOpacity: 0.35
 });
    layer = new google.maps.FusionTablesLayer(tableid);
    layer.setQuery("SELECT 'geometry' FROM " + tableid);
    layer.setMap(map);
    bermudaTriangle.setMap(map);


}

google.maps.event.addDomListener(window, 'load', initialize);

</script>
</head>
 <body>
<div id="map-canvas"></div>
</body>
 </html>`

但是它只显示自定义多边形而不是边界。您可以共享一些示例代码来显示相同的

您希望代码的哪一部分显示邮政编码边界?layer=new google.maps.fusionableslayertableid;当我使用你的代码时,我看到了FusionTablesLayer和Polygon。当然,你必须放大,因为多边形太小,在zoom 4上可能看不到。我想在多边形上显示序列号,那么怎么做??