<html>
<head>
<title></title>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=places&sensor=true"></script>
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
var input = document.getElementById('location');
var options = {
types: ["locality"]
};
autocomplete = new google.maps.places.Autocomplete(input, options);
});
</script>
</head>
<body>
<div>Location: <input type="text" id="location" style="width:400px;" /></div>
</body>
</html>
オートコンプリートの場所のテキスト入力を生成するコードがあります。Googleのサポートされているタイプのリスト(http://code.google.com/apis/maps/documentation/places/supported_types.html)には、すべてが戻ってくることを望まない場合に使用するタイプとして「地域」が示されています。結果(ビジネスなど)。結果が出ません。
基本的に、私が達成したいのは、都市(IE:トロント)を検索し、「トロント、オンタリオ州、カナダ」のような結果のみを表示することです。おそらく、このAPIをどのように実装するかについて混乱しています。
返信ありがとうございます!