There are few examples of work with google maps. Implemented examples for Markers, Markers cluster, Geocode, Autocomplete, Directions, Elevation, Layers, Panorama, Polygon, Polyline, GPX track features.
1 . Clone repository:
git clone https://github.com/antonshell/google-maps-examples.git
2 . Install dependencies
composer install
3 . Set API KEY:
Create env file
nano .env.local
Set variable
GOOGLE_MAPS_API_KEY=YOUR_API_KEY
4 . Run built in web-server:
cd public
php -S 127.0.0.1:8000
5 . Open in browser:
1 . Clone repository:
git clone https://github.com/antonshell/google-maps-examples.git
2 . Run docker compose:
cd google-maps-examples
docker-compose up -d
3 . Set API KEY:
Create env file
nano .env.local
Set variable
GOOGLE_MAPS_API_KEY=YOUR_API_KEY
3 . Open in browser:
Create api key as described in the documentation: https://developers.google.com/maps/documentation/javascript/get-api-key
Here is more detailed unofficial tutorial: https://www.wpmapspro.com/docs/how-to-create-an-api-key/
There is list of enabled APIs:
Examples code can be found in templates/main directory
http://127.0.0.1:18080/markers
References:
http://127.0.0.1:18080/clustering
References:
http://127.0.0.1:18080/geocode
References:
http://127.0.0.1:18080/autocomplete
References:
http://127.0.0.1:18080/directions
References:
http://127.0.0.1:18080/elevation
References:
References:
http://127.0.0.1:18080/panorama
References:
http://127.0.0.1:18080/polygon
References:
http://127.0.0.1:18080/polyline
References:
References: