Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/esadewater/livewire-maps
Basic Google Maps-implementation for Laravel-Livewire currently supporting map-markers and map-move-listeners.
https://github.com/esadewater/livewire-maps
laravel livewire livewire-component
Last synced: about 1 month ago
JSON representation
Basic Google Maps-implementation for Laravel-Livewire currently supporting map-markers and map-move-listeners.
- Host: GitHub
- URL: https://github.com/esadewater/livewire-maps
- Owner: esadewater
- License: mit
- Created: 2022-09-08T13:04:43.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-19T20:13:23.000Z (over 1 year ago)
- Last Synced: 2024-10-12T14:39:56.495Z (2 months ago)
- Topics: laravel, livewire, livewire-component
- Language: JavaScript
- Homepage:
- Size: 1.2 MB
- Stars: 16
- Watchers: 3
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
> :warning: **ALPHA status**: This project is still in the early stages of development. It is not yet ready for production use. Further development is postponed until the release of Livewire v3.
# Livewire-Maps
Basic Google Maps-implementation for Laravel-Livewire currently supporting:
- Map-Markers ([view docs](./docs/MapMarkers.md))
- Map-Move-Listeners ([view docs](./docs/MapMoveListener.md))## Example
You can find an example here: [esadewater/livewire-maps-sample](https://github.com/esadewater/livewire-maps-sample)## Installation
You can install the package via composer:
```bash
composer require esadewater/livewire-maps
```[//]: # (You can publish the assets with:)
[//]: # ()
[//]: # (```bash)[//]: # (php artisan vendor:publish --tag="livewire-maps-assets")
[//]: # (```)
Install the map marker npm package:
```bash
npm install @googlemaps/markerclusterer
```Then include the JavaScript resources in your app.js:
```javascript
import {init} from "../../vendor/esadewater/livewire-maps/resources/js/LiveWireMaps";
init();
```You can publish the config file with:
```bash
php artisan vendor:publish --tag="livewire-maps-config"
```You can publish the views using
```bash
php artisan vendor:publish --tag="livewire-maps-views"
```## Usage
Get an API-key for the Google Maps Platform from [here](https://console.cloud.google.com/google/maps-apis/start) and add it to your .env-file:
```dotenv
GOOGLE_MAPS_API_KEY=YOUR_KEY_GOES_HERE
```Add the @livewireMapsScripts directive right after @livewireScripts and your app.js:
```php
@livewireScripts
@livewireMapsScripts
```Then you are ready to start with a basic map with a center point and a zoom:
```php
```
[//]: # (## Testing)
[//]: # ()
[//]: # (```bash)[//]: # (composer test)
```## Credits
- [Erik Sadewater](https://github.com/esadewater)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.