[ GAE Google App Engine ][ Python ][ Google Bigtable ][ Google Maps API ]
[ Google AJAX API ]
万歩計MAPで
コースを作成する時ルートを表示するのは、AJAX、
スタート地点と、ゴール地点をBigtableに保存する時は、GAEが動く。
http://code.google.com/apis/ajax/playground/#map_directions_advanced
をコピーしただけの状態であれば、
FORMには「onsubmit」が使われていたが、
Javascriptの動作と、Bigtableに保存する動作を分岐させるために
「onclick」を使った。
今回、ここを考えるのを一番苦労した。
最善ではないのかもしれない。
変更点は以下の通り。
<form action="#" onsubmit="setDirections(this.from.value, this.to.value, this.locale.value); return false"> ・ ・ ・ <input name="submit" type="submit" value="Get Directions!" />
を「onclick」を使用して、以下のように変更。
・ ・ <form id="form" name="form" method="" action="#" > ・ ・ ・ <input name="submit1" type="button" value="地図で確認!" onclick="setDirections(document.form.frompoint.value, document.form.topoint.value, document.form.localeset.value); return false"/> <input name="submit2" type="button" value="保存する" onclick="goGAEdata();"/> ・ ・
また、
GAEへデータを保存するのに、Javascriptで「goGAEdata()」を作成し動作させた。
・
・
function goGAEdata(){
document.form.method = "post";
document.form.action = "/mycourse/add";
document.form.submit();
}
・
・
一番どうするか時間がかかったが、
あまり納得がいっていない。
もうちょっとなんとかならんもんかと思う。
私がつくったアプリ↓
協調型意思決定支援システム「○ 賛否両論 ×(ベータ版)」
http://sanpiryoron.appspot.com/
協調型プロジェクトタスク管理ツール「キャッチ&リリース(ベータ版)」
http://ctchandrls.appspot.com/