5

次のコードでExpressionEngine2.5.3とGoogleMapsfor ExpressionEngine 3.0.190(別名3.1ベータ版)を使用しています。

{exp:gmap:init id="map1" class="gmap" scrollwheel="false" style="width:930px;height:500px" clusterStyles="{url: '/assets/images/cluster-icon-blue.png', textColor: '#fff', textSize: '12', height: 52, width: 53, anchor: [0, 0]}" overviewMapControl="true" overviewMapControlOptions="{opened:true}"}

{exp:channel:entries channel="people" status="open" disable="categories|category_fields|member_data|pagination" limit="1000" dynamic="no" sort="asc"}
    {cf_people_geo_location id="map1" show_one_window="true" icon="/assets/images/aabc-map-icon-white.png" infobox="true" offsetY="-45" offsetX="15" closeBoxMargin="5px" class="ui-infobox-dark" closeBoxURL="/themes/third_party/gmap/css/images/white-close-button.png" style="width: '250px'" clearanceX="10" show_one_window="true" clustering="true"}
        <p><a href="/register/{url_title}/" title="View {title}">View {title} &raquo;</a></p>
    {/cf_people_geo_location}
{/exp:channel:entries}

ページの読み込み時にマップが使用するズームレベルを設定することはできますか?プロットされているポイントに基づいて自動的に設定されているようですが、この値を上書きして、いくつかのノッチを拡大したいと思います。

ありがとう、

Ste

4

2 に答える 2

1

zoom=""gmapタグのパラメーターがありますが、機能しないことがある(または、何らかの理由で正しく使用されていない)場合があります。

希望のレベルにズームするために、ページの最後に、通常のGoogleマップ(アドオンではない)コードを手動で追加しました。

<script>
  map1_map.setZoom(15);
</script>
于 2012-11-09T14:07:40.503 に答える
1

extend_boundsパラメータを使用して、「false」に設定します

https://objectivehtml.com/google-maps/documentation/tag/marker#extend_bounds

これを試して:

{exp:gmap:init id="map1" class="gmap" scrollwheel="false" style="width:930px;height:500px" clusterStyles="{url: '/assets/images/cluster-icon-blue.png', textColor: '#fff', textSize: '12', height: 52, width: 53, anchor: [0, 0]}" overviewMapControl="true" overviewMapControlOptions="{opened:true}" zoom="10"}

{exp:channel:entries channel="people" status="open" disable="categories|category_fields|member_data|pagination" limit="1000" dynamic="no" sort="asc"}
    {cf_people_geo_location id="map1" show_one_window="true" icon="/assets/images/aabc-map-icon-white.png" infobox="true" offsetY="-45" offsetX="15" closeBoxMargin="5px" class="ui-infobox-dark" closeBoxURL="/themes/third_party/gmap/css/images/white-close-button.png" style="width: '250px'" clearanceX="10" show_one_window="true" clustering="true" extend_bounds="false"}
        <p><a href="/register/{url_title}/" title="View {title}">View {title} &raquo;</a></p>
    {/cf_people_geo_location}
{/exp:channel:entries}
于 2012-11-09T17:43:29.970 に答える