【问题标题】:Google Maps rendering - strange circles cover the map谷歌地图渲染——奇怪的圆圈覆盖了地图
【发布时间】:2016-06-20 12:52:11
【问题描述】:

我正在使用 angularjs-google-maps 指令,我的代码如下所示:

(function () {
  define(['angular', 'app'], function (angular, app) {
    app.directive('customMap', function () {
      var customMapTemplate =
        "<div class= \"vertical-collapse\" ng-class=\"{ 'opened' : showMap() }\">" +
        "       <div map-lazy-load=\"https://maps.google.com/maps/api/js\"" +
        "             map-lazy-load-params=\"{{googleMapsUrl}}\" >" +
        "           <ng-map center=\"64,-21\" zoom=\"10\"></ng-map>" +
        "       </div >" +
        "</div> " +
        "&nbsp;";
      // console.log(customMapTemplate);
      return {
        restrict: 'E',
        template: customMapTemplate,
        controller: function ($scope) {
          console.log($scope.showMap());
          $scope.googleMapsUrl = 'https://maps.googleapis.com/maps/api/js?key=AIzaSyBUKGtliE38keJLwWjbOrM2uPFiSSDRKZA';
        },
        scope: {
          'showMap': '&showMap'
        }
      };
    });
  });
}).call(this);

并且此地图无法正确渲染。我上面有一些奇怪的圆圈,不知道为什么?

知道为什么吗?

【问题讨论】:

  • 显然是一个 css 问题,在你的 css 中搜索影响图像的规则(在地图内)
  • 非常感谢! :) 这是非常有用的建议!

标签: javascript angularjs google-maps ng-map angularjs-google-maps


【解决方案1】:

问题在于项目中的错误 CSS 样式 img (border-radius: 100%) 是由某人全局设置的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-23
    相关资源
    最近更新 更多