html 带有半径边框的Google地图

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html 带有半径边框的Google地图相关的知识,希望对你有一定的参考价值。

<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true"></script>
<script>

// This example creates circles on the map, representing
// populations in North America.

// First, create an object containing LatLng and population for each city.
var citymap = {};
citymap['sydney'] = {
  center: new google.maps.LatLng(-33.868326, 151.208328),
  population:6000
};


var cityCircle;

function initialize() {
  // Create the map.
  var mapOptions = {
    zoom: 12,
    center: new google.maps.LatLng(-33.868326, 151.208328),
    mapTypeId: google.maps.MapTypeId.roadmap
  };

  var map = new google.maps.Map(document.getElementById('map-canvas'),
      mapOptions);

  // Construct the circle for each value in citymap.
  // Note: We scale the area of the circle based on the population.
  for (var city in citymap) {
    var populationOptions = {
      strokeColor: '#ff0000',
      strokeOpacity: 0.8,
      strokeWeight: 2,
      fillColor: '#ff0000',
      fillOpacity: 0.35,
      map: map,
      center: citymap[city].center,
      radius: Math.sqrt(citymap[city].population) * 100
    };
    // Add the circle for this city to the map.
    cityCircle = new google.maps.Circle(populationOptions);
  }
}

google.maps.event.addDomListener(window, 'load', initialize);
    </script>
<div id="map-canvas"></div>

以上是关于html 带有半径边框的Google地图的主要内容,如果未能解决你的问题,请参考以下文章

Google Chrome 中的输入类型搜索边框半径问题

嵌入谷歌地图的iFrame上的CSS边框半径,不起作用

如何快速在 UIView 上应用带有边框的尖角半径?

CSS - 带有边框半径的动画比例

半径/最近的结果 - Google Maps API

为嵌入的 YouTube 视频添加边框半径