kawasin73 / tripmap

1 stars 0 forks source link

Google Maps API について #3

Open futakw opened 6 years ago

futakw commented 6 years ago

https://developers.google.com/maps/get-started/?hl=ja

・Google Place API ->「入力ワード」から、「一致する場所の情報(緯度経度など)」をjson形式で返す ・Google Maps directions API ->「start地点、中継地点(23箇所まで)、end地点」から、「最適ルート・所要時間・距離」などをjson形式で返す

これらを使うことで以下の流れになるかなと思う。 ①観光地情報を掲載するページから、上位の観光地の名前をスクレイピング ②名前から緯度経度情報を得て地図にポインタを表示 ③ユーザに入力してもらった「start地点end地点・start時間end時間・必須観光地」また、「各観光地の所要時間」を元に、最適な観光地数、観光地取捨選択、ルートを探す

③は、川辺くんガンバ笑

futakw commented 6 years ago
2018-05-15 20 24 45

今んとこ実装したのはこんな感じ(サンプルコード丸パクリ)

kawasin73 commented 6 years ago

え、すごい

futakw commented 6 years ago

https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-directions?hl=ja より想定しているサイトに近いサンプルコードがあった

futakw commented 6 years ago

https://developers.google.com/maps/documentation/javascript/examples/places-searchbox?hl=ja で、それにこのサーチボックスを付け足して、中継地点を選ばせる

で、前のせたウェイポイント↓をやる https://developers.google.com/maps/documentation/javascript/directions?hl=ja

この3つを組み合わせられれば行けると思う