Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/460.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
Javascript 角度谷歌地图自定义标记谷歌对象_Javascript_Angularjs_Google Maps_Angular Google Maps - Fatal编程技术网

Javascript 角度谷歌地图自定义标记谷歌对象

Javascript 角度谷歌地图自定义标记谷歌对象,javascript,angularjs,google-maps,angular-google-maps,Javascript,Angularjs,Google Maps,Angular Google Maps,我正在使用谷歌地图,我想使用一个自定义标记。我不想让它成为一个图像。我想要这样的东西: icon: { path: google.maps.SymbolPath.CIRCLE, scale: 12, fillColor: '#2677FF', fillOpacity: 1, strokeColor: '#ffffff', strokeOpacity: 1,

我正在使用谷歌地图,我想使用一个自定义标记。我不想让它成为一个图像。我想要这样的东西:

icon: {
          path: google.maps.SymbolPath.CIRCLE,
          scale: 12,
          fillColor: '#2677FF',
          fillOpacity: 1,
          strokeColor: '#ffffff',
          strokeOpacity: 1,
          strokeWeight: 6
}
但是我得到了一个错误,
谷歌没有定义
。我怎样才能抓住那个物体

以下是我的看法:

<ui-gmap-google-map center='map.center' zoom='map.zoom' pan='true' refresh='true'>

<ui-gmap-marker coords="map.currentPos.coords" options="map.currentPos.options" events="map.currentPos.events" idKey="map.currentPos.id" icon="map.currentPos.icon">
            </ui-gmap-marker>

</ui-gmap-google-map>

google.maps.SymbolPath类示例用法

var marker = new google.maps.Marker({
    position: map.getCenter(),
    icon: {
      path: google.maps.SymbolPath.CIRCLE,
      scale: 10
    },
    draggable: true,
    map: map
  });

google.maps.SymbolPath类示例用法

var marker = new google.maps.Marker({
    position: map.getCenter(),
    icon: {
      path: google.maps.SymbolPath.CIRCLE,
      scale: 10
    },
    draggable: true,
    map: map
  });

好的,我找到了方法:

uiGmapGoogleMapApi.then(function(maps){
      $scope.map.currentPos.icon = {
          path: google.maps.SymbolPath.CIRCLE,
          scale: 12,
          fillColor: '#2677FF',
          fillOpacity: 1,
          strokeColor: '#ffffff',
          strokeOpacity: 1,
          strokeWeight: 6
      }
    });

好的,我找到了方法:

uiGmapGoogleMapApi.then(function(maps){
      $scope.map.currentPos.icon = {
          path: google.maps.SymbolPath.CIRCLE,
          scale: 12,
          fillColor: '#2677FF',
          fillOpacity: 1,
          strokeColor: '#ffffff',
          strokeOpacity: 1,
          strokeWeight: 6
      }
    });