Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricewijnia committed Nov 23, 2020
2 parents 10b3f8c + 0298e8c commit 4dc4b42
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 28,770 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ The resulting data will have this format:
formatted_address: string,
latitude: float,
longitude: float
address_components: array // https://developers.google.com/maps/documentation/javascript/geocoding#GeocodingAddressTypes
}
```

Expand All @@ -69,11 +70,22 @@ MapsAddress::make(__('Address'), 'address')
->types(['address' ,'establishment']);
```

You can also pass parameters to Map js request and all options available for map/autocomplete/geocoder class. For example to specify a language and regions and filter the components:

```php
MapsAddress::make(__('shop_admin.places.address'), 'address')->types([])
->scriptUrlParams(['region' => 'jp', 'language' => 'ja'])
->autoCompleteOptions(['componentRestrictions' => ['country' => ['jp']]])
->mapOptions(['componentRestrictions' => ['country' => ['jp']]])
```

|Option|Description|Default|
|------|-----------|-------|
|zoom|Set the default zoom level of the map|10|
|center|Set the initial centering point of the map|```['lat' => 52.370216, 'lng' => 4.895168]```|
|types|Set the type of places that should be shown options are: establishment, address, geocode|```['address']```|



|allowMapClick|Allow user to click on the map to get the address|true|
|autoCompleteOptions|Set options for AutoComplete class initialization. https://developers.google.com/maps/documentation/javascript/reference/places-widget#Autocomplete|N/A |
|geocodeOptions|Set options for Geocoder class initialization. https://developers.google.com/maps/documentation/javascript/reference/geocoder#GeocoderRequest|N/A |
|mapOptions|Set options for Map class initialization. https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions|N/A |
|scriptUrlParams|Set parameters during the request of Google Map API js. https://developers.google.com/maps/documentation/javascript/url-params |N/A|
Loading

0 comments on commit 4dc4b42

Please sign in to comment.