Download the PHP package lachlanhickey/laravel-maps without Composer
On this page you can find all versions of the php package lachlanhickey/laravel-maps. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lachlanhickey/laravel-maps
More information about lachlanhickey/laravel-maps
Files in lachlanhickey/laravel-maps
Package laravel-maps
Short Description Maps for your Laravel application
License MIT
Homepage https://gitlab.com/gonoware/laravel-maps
Informations about the package laravel-maps
Maps for your Laravel application
Using this package you can easily display maps on your website.
Supported map services:
- Google Maps
- OpenStreetMap
- Bing Maps
- MapQuest
- Yandex Maps
- MapKit (beta)
Note: Yandex Maps API does not work in Chrome.
Features
| Google Maps | OpenStreetMap | Bing Maps | MapQuest | Yandex Maps | MapKit | |
|---|---|---|---|---|---|---|
| Map | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Markers | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Marker Links | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Marker Popups | ✔ | ✔ | ✔ | ✔ | ✔ | ❌ |
| Custom Marker Icons | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| Marker Click Event | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
Installation
This package can be installed through Composer.
Publish the compiled assets to public/vendor/maps with one of these
commands:
When updating, use the
--forceswitch to overwrite existing assets:
Optionally, you can also publish the config file of this package with this
command to config/vendor/maps.php:
Usage
Load the map styles by adding the following directive to your
Blade template before the </head> closing tag.
Then add the following directive to your Blade template
before the </body> closing tag, to load the map scripts.
Basic Map
Display a map by adding the @map directive to your Blade template.
Map With Markers
You can also show markers / pins / annotations:
Marker Links
Open a url when a marker is clicked.
Marker Popups
Show a popup when a marker is clicked. The popup attribute may contain HTML markup.
Custom Marker Icons
Show a custom marker icon. Absolute and relative URLs are supported.
Additionally you may also specify the icon image size and anchor in pixels. The image will be aligned so that the tip of the icon is at the marker's geographical location.
Styling
To adjust the height of the map use CSS:
Change the background of the map container:
Fade in by default when using Bootstrap 3.3.7 or 4+. To replicate or modify the animation use following CSS:
Events
Map Initialized
The event LaravelMaps:MapInitialized will be dispatched when a map and its markers were initialized. The DOM element, map,
markers and service name can be accessed via the event details.
Please refer to the respective documentation for advanced customization:
Marker Clicked
The event LaravelMaps:MarkerClicked will be dispatched when a marker was clicked. The DOM element, map, marker and
service name can be accessed via the event details.
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
License
MIT
Copyright (c) 2018-present Go NoWare