Google Place API 限制 - 不是使用限制
Google Place API Limit - NOT usage limit
我已经设法启动并运行了Google Places,但是我可以添加的国家/地区变量的数量似乎有限制。我的代码基于他们的一个示例:
https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-hotelsearch
但是每次我尝试将一个国家/地区添加到var countries
部分并重新加载页面时,我都会得到一个空白页面,底部只有一个下拉菜单和一些文本。
我可以添加到 Google 地方信息的国家/地区变量数量是否有限制?
更新:
添加额外的国家/地区。
javascript与上面的例子相同:
var map, places, infoWindow;
var markers = [];
var autocomplete; var countryRestrict = { 'country': 'uk' };
var MARKER_PATH = 'maps.gstatic.com/intl/en_us/mapfiles/marker_green';
var hostnameRegexp = new RegExp('^https?://.+?/');
var countries = {
'at': {
center: new google.maps.LatLng(47.5, 14.5),
zoom: 6 },
'be': {
center: new google.maps.LatLng(50.5, 4.4),
zoom: 6 },
然后在HTML中有一个下拉菜单:
<div id="controls">
<select id="country">
<option value="at">Austria</option>
我很确定这不是编码问题,更重要的是当包括超过 18 个国家/地区时,它似乎停止工作。
很抱歉耽搁了。
var countries = {
'at': {
center: new google.maps.LatLng(47.0, 14.5),
zoom: 6 },
'be': {
center: new google.maps.LatLng(52.5, 4.4),
zoom: 6 },
'cz': {
center: new google.maps.LatLng(49.817492, 15.472962),
zoom: 6 },
'bz': {
center: new google.maps.LatLng(17.189877, -88.497650),
zoom: 6 },
'hn': {
center: new google.maps.LatLng(15.199999, -86.241905),
zoom: 6 },
'cr': {
center: new google.maps.LatLng(9.748917, -83.753428),
zoom: 6 },
'co': {
center: new google.maps.LatLng(4.570868, -74.297333),
zoom: 6 },
'au': {
center: new google.maps.LatLng(-25.3, 133.8),
zoom: 4
},
'br': {
center: new google.maps.LatLng(-14.2, -51.9),
zoom: 3
},
'ca': {
center: new google.maps.LatLng(62, -110.0),
zoom: 3
},
'fr': {
center: new google.maps.LatLng(46.2, 2.2),
zoom: 5
},
'de': {
center: new google.maps.LatLng(51.2, 10.4),
zoom: 5
},
'mx': {
center: new google.maps.LatLng(23.6, -102.5),
zoom: 4
},
'nz': {
center: new google.maps.LatLng(-40.9, 174.9),
zoom: 5
},
'it': {
center: new google.maps.LatLng(41.9, 12.6),
zoom: 5
},
'za': {
center: new google.maps.LatLng(-30.6, 22.9),
zoom: 5
},
'es': {
center: new google.maps.LatLng(40.5, -3.7),
zoom: 5
},
'pt': {
center: new google.maps.LatLng(39.4, -8.2),
zoom: 6
},
'us': {
center: new google.maps.LatLng(37.1, -95.7),
zoom: 3
},
'uk': {
center: new google.maps.LatLng(54.8, -4.6),
zoom: 5
}
};
和 html:
<div id="controls">
<select id="country">
<option value="all">All</option>
<option value="bz">Belize</option>
<option value="cz">Czech Republic</option>
<option value="hn">Honduras</option>
<option value="cr">Costa Rica</option>
<option value="co">Colombia</option>
<option value="at">Austria</option>
<option value="be">Belgium</option>
<option value="au">Australia</option>
<option value="br">Brazil</option>
<option value="ca">Canada</option>
<option value="fr">France</option>
<option value="de">Germany</option>
<option value="mx">Mexico</option>
<option value="nz">New Zealand</option>
<option value="it">Italy</option>
<option value="za">South Africa</option>
<option value="es">Spain</option>
<option value="pt">Portugal</option>
<option value="us" selected>U.S.A.</option>
<option value="uk">United Kingdom</option>
</select>
</div>
相关文章:
- 如何更改bigquery API中的计费层选项
- Amazon S3 REST API大小不正确
- 客户端服务器REST API captcha实现
- 使用Facebook live API创建实时视频对象时的隐私设置
- 谷歌放置API:按国家或餐馆名称搜索餐馆
- MeteorJS:在带有回调的vzaar api上正确使用wrapAsync
- 是否可以控制获取哪些Google地图脚本(JavaScript API)
- API密钥使用和检查示例
- 谷歌地图API v3不适用于移动浏览器或PhoneGap
- 任何方式使AJAX调用Gmail API,而无需通过JS库
- 谷歌地图JS API+JSON-多个标记没有显示
- 单击超链接时,如何使用Google Maps API v3缩放地图
- 如何在 API 调用后和 if 语句中启用提交按钮
- Google Place API 限制 - 不是使用限制
- 如何从autocomplete.getPlace()获取Google Place api结果
- 使用 google place api 添加一个地点,使用 jQuery.ajax 进行定位
- Google Place 自动完成 API 下拉菜单不会显示在 Modal 中
- 使用 xhr 请求 Google Place API 遇到了 CORS 问题
- 如何在angularjs控制器中进行google place api搜索
- Google Place API库不能动态加载