hypejunction/google_maps_autocomplete
Composer 安装命令:
composer require hypejunction/google_maps_autocomplete
包简介
Replaces location input with Google Maps Autocomplete
README 文档
README
Features
- Replaces location input with Google Maps Autocomplete
API Key
Make sure your Google API key supports:
- Google Maps JavaScript API
- Google Places API Web Service
Notes
Autocomplete options
You can pass options to google.maps.places.Autocomplete component using data- attributes of the input field.
echo elgg_view_input('location', [ 'name' => 'city_in_france', 'data-types' => json_encode(['(cities)']), 'data-component-restrictions' => json_encode(['country' => 'fr']), ]);
You can further filter options for each input using 'options', 'input/location' JavaScript plugin hook.
Accessing address parts
You can access address parts, UTC offset and lat/long of the location in your action:
$location = get_input('my_input_name'); $extended = get_input('__location'); $index = array_search($location, $extended['location']); $street_address = $extended['street_address'][$index]; $postal_code = $extended['postal_code'][$index]; ...
统计信息
- 总下载量: 48
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2017-08-29