调整 NG-Map (AngularJS) 中的地图标记大小?

问题描述 投票:0回答:1

我正在尝试使用 scaledSize 调整地图图标的大小,但是图标没有改变,这是我的代码:

这有效:

<marker icon="{resource.marker_circle}" class="marker-icon" id="{resource.id}" position="{resource.address}" title="{resource.name}" id="resource_clicked" value="{resource.id}" 

on-mouseover="showInfoWindow(event, '{resource.id}')">

但是当我尝试调整图标大小时,它不适用于scaledSize:

  <div class="map-container">
  <div style="margin: 0 auto; overflow:hidden; background: white;">
    <div style=" width: 100%; margin:center; height: 257px; border: none; border-radius: 25px;" map-lazy-load="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY">
      <ng-map ng-map-custom style="width: 100%;height: 100%;border: none; border-radius: 25px;" center="Santa Ana, CA" zoom="11">
        {!resources.filter('category_ref', _equals(my.category)).each(per_page: 30, page:response._page_44_resources_repeatingsection1) do |resource|}


        <marker icon="{url: resource.marker_circle, scaledSize:[32,40], origin: [0,0], anchor: [16,40]}" class="marker-icon" id="{resource.id}" position="{resource.address}" id="resource_clicked" value="{resource.id}"
        on-mouseover="showInfoWindow(event, '{resource.id}')"></marker>

        <info-window id="{resource.id}" max-width="300" style="display: none;">
          <div ng-non-bindable="">
            <div id="siteNotice"></div>
            <a href="" response-click="go">
              <h3 id="firstHeading" class="firstHeading">Location - # of Searches</h3>
            </a>
            <div id="bodyContent">
              <p>
                {resource.city}
              </p>
            </div>
          </div>
        </info-window>

        {!end}
      </ng-map>
    </div>
  </div>
</div>
angularjs google-maps ng-map
1个回答
0
投票

尝试按照以下语法使用它 -

{
  url: require('../images/vehicle-active.png'), // gives a data://<value>
  scaledSize: {
    height: 40,
    width: 40
  }

}

© www.soinside.com 2019 - 2024. All rights reserved.