質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Google API

Googleは多種多様なAPIを提供していて、その多くはウェブ開発者向けのAPIです。それらのAPIは消費者に人気なGoogleのサービス(Google Maps, Google Earth, AdSense, Adwords, Google Apps,YouTube等)に基づいています。

Google マップ

Google Mapは、Google社がオンラインで提供している地図・ローカル検索サービスです。GIS(Geographic Information System:地理情報システム)の中の「WebGIS」に該当します。地図・航空写真・地形の表示方式があり、それぞれユーザーが縮尺を調整して表示させることができます。地域の情報サービスを検索する機能やルート検索の機能も搭載されています。

Q&A

解決済

1回答

5392閲覧

google mapの料金について

k.t.est

総合スコア49

Google API

Googleは多種多様なAPIを提供していて、その多くはウェブ開発者向けのAPIです。それらのAPIは消費者に人気なGoogleのサービス(Google Maps, Google Earth, AdSense, Adwords, Google Apps,YouTube等)に基づいています。

Google マップ

Google Mapは、Google社がオンラインで提供している地図・ローカル検索サービスです。GIS(Geographic Information System:地理情報システム)の中の「WebGIS」に該当します。地図・航空写真・地形の表示方式があり、それぞれユーザーが縮尺を調整して表示させることができます。地域の情報サービスを検索する機能やルート検索の機能も搭載されています。

0グッド

1クリップ

投稿2018/12/11 09:20

編集2018/12/11 10:11

本家の料金表を見てもいまいちよくわからないのですが、

https://cloud.google.com/maps-platform/pricing/sheet/?hl=ja

下記関数を利用した場合には、どのカテゴリのAPIに該当するのでしょうか?

new google.maps.Map : Static Maps ?
new google.maps.Marker : ?
new google.maps.LatLng : ?
new google.maps.Polyline : ?
new google.maps.DirectionsRenderer( rendererOptions ) : Directinos API?
new google.maps.DirectionsService() : Directions API ?
directionsService.route(request, function (response, status) {}) : Directions API?

また、例えばmarkerの設定をするのに、new google.maps.Markerやnew google.maps.MarkerImage、new google.maps.Sizeなどを利用した場合、その1つ1つが課金対象なのでしょうか?

javascript

1var marker = new google.maps.Marker({ 2 position: mylatlng, 3 map: map, 4 icon : new google.maps.MarkerImage( 5 // マーカーの画像URL 6 'image/marker.png', 7 // マーカーのサイズ 8 new google.maps.Size(45, 45), 9 // 画像の基準位置 10 new google.maps.Point(0, 0), 11 // Anchorポイント 12 new google.maps.Point(10, 24) 13 ) 14 });

どなたか詳しくご教示頂ければ幸甚で御座います。

###テストコード

javascript

1 function calcRoute(startLatLng,targetLatLng){ 2 var request = { 3 origin: new google.maps.LatLng(startLatLng[0], startLatLng[1]), // スタート地点 4 destination: new google.maps.LatLng(targetLatLng[0], targetLatLng[1]), // ゴール地点 5 travelMode: google.maps.DirectionsTravelMode.WALKING // 移動手段 6 }; 7 8 directionsService.route(request, function (response, status) { 9 if(directionsDisplay){ 10 directionsDisplay.setMap(null); 11 directionsDisplay.setPanel(null); 12 } 13 14 if (status === google.maps.DirectionsStatus.OK) { 15 var rendererOptions = { 16 map: map, // 描画先の地図 17 draggable: true, // ドラッグ可 18 //preserveViewport: true // centerの座標、ズームレベルで表示 19 suppressMarkers: true // デフォルトのマーカーを削除 20 }; 21 directionsDisplay = new google.maps.DirectionsRenderer( rendererOptions ); 22 directionsDisplay.setDirections( response ); 23 directionsDisplay.setMap(map); 24 25 /*ルートの詳細表示*/ 26 directionsDisplay.setPanel(document.getElementById("directions_panel")); 27 28 /* 出発地点・到着地点マーカーが移動された時 */ 29 google.maps.event.addListener(directionsDisplay, 'directions_changed',function() { 30 currentDirections=directionsDisplay.getDirections(); 31 var route=currentDirections.routes[0]; 32 var s=""; 33 for(var i=0; i<route.legs.length; i++) { 34 var routeSegment=i+1; 35 s+=route.legs[i].start_address+'to'; 36 s+=route.legs[i].end_address+'\n'; 37 s+=route.legs[i].distance.text; 38 } 39 dbg("directions_changed:"+s); 40 }); 41 } 42 }); 43 }

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

課金基準となる回数は、マップ自体の描画回数です(公式)。その中に線やマーカーをいくら描いても、地図をいくら移動・ズームなどさせても料金は変化しません。

なお、JavaScript APIはDynamic Mapの区分です(Static Mapは<img>タグで画像としてアクセスするもので、全く別物です)。

投稿2018/12/11 09:41

maisumakun

総合スコア145184

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

k.t.est

2018/12/11 09:52

ご回答有難う御座います。料金表で言うところの「マップ」に当たる部分は、マップ自体の描画回数ということは分かりました! 「ルート」の方はどうなりますでしょうか?これは呼び出し毎に課金になるのでしょうか? new google.maps.DirectionsRenderer( rendererOptions ) : Directinos API? → 課金対象外? new google.maps.DirectionsService() : Directions API ? → 課金対象外? directionsService.route(request, function (response, status) {}) : Directions API? → 課金対象?
k.t.est

2018/12/11 10:14

追加コメント有難う御座います。 テストコードを質問内に追加したのですが、この場合は、calcRouteの呼び出し毎(1地点から1地点までのルートを表示)に、価格表の「ルート」の「Directions」は何回課金対象となるのでしょうか? また、マーカー移動でルートが変更されたら、これは「Directions」が1回カウントされるということでしょうか?
k.t.est

2019/02/19 09:52

実際にGoogle Cloud PlatformでAPIの回数を確認しました。ルート変更すると、Directionsが1回カウントされるようです。ただ、表示ルートの途中をドラッグをして、リルートさせると複数回のapiがリクエストされるようで、リクエスト回数のカウント方法がよくわからずでした。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問