テーマ共通 COMMON
Q.BIRTHでのGoogleMapの拡大率を調整したい
ページビルダー内のGoogleマップで地図の拡大率を調整したいのですが方法はありますか。
A.下記ファイルの該当箇所を編集します
編集ファイル:googlemap.js
編集する箇所:
zoom: 18,の値を変更し調整ください。
// Initialize the map and the custom overlay. function initMap(mapId, address, mapSaturation, useCustomOverlay, srcImage, text) { var geocoder = new google.maps.Geocoder(); geocoder.geocode({'address': address}, function(results, status) { if (status == 'OK') { var mapOptions = { center: results[0].geometry.location, mapTypeId: google.maps.MapTypeId.ROADMAP, disableDefaultUI: true, zoom: 18, styles: [{ stylers: [{ saturation: mapSaturation }] }] }; var map = new google.maps.Map(document.getElementById(mapId), mapOptions); if (useCustomOverlay) { var swBound = new google.maps.LatLng(results[0].geometry.location.lat(), results[0].geometry.location.lng()); var neBound = new google.maps.LatLng(results[0].geometry.location.lat(), results[0].geometry.location.lng()); var bounds = new google.maps.LatLngBounds(swBound, neBound); overlay = new PBCustomOverlay(bounds, srcImage, map, text); } else { var marker = new google.maps.Marker({ position: results[0].geometry.location, map: map }); } } }); }
この記事は役に立ちましたか?
もし参考になりましたら、下のボタンで教えてください。
今後の記事作成の参考とさせて頂きます!
0