All Projects → GeneaLabs → Nova Map Marker Field

GeneaLabs / Nova Map Marker Field

Licence: mit
Provides an visual interface for editing latitude and longitude coordinates.

Projects that are alternatives of or similar to Nova Map Marker Field

Watchable
Enable users to watch various models in your application.
Stars: ✭ 65 (-32.29%)
Mutual labels:  laravel-5-package, package
Skeleton Nova Tool
A skeleton repository for Spatie's Nova Packages
Stars: ✭ 191 (+98.96%)
Mutual labels:  package, nova
Nova Cashier Manager
Managing Stripe subscriptions inside the incredible Laravel Nova admin panel.
Stars: ✭ 150 (+56.25%)
Mutual labels:  package, nova
Blogetc
Easily add a full Laravel blog (with built in admin panel and public views) to your laravel project with this simple package.
Stars: ✭ 198 (+106.25%)
Mutual labels:  laravel-5-package, package
Nova-Dark-Theme
A dark theme for Laravel Nova
Stars: ✭ 72 (-25%)
Mutual labels:  nova, laravel-5-package
Laravel Gitscrum
GitScrum is a Project Management Tool, developed to help entrepreneurs, freelancers, managers, and teams Skyrocket their Productivity with the Agile methodology and Gamification.
Stars: ✭ 2,686 (+2697.92%)
Mutual labels:  laravel-5-package, package
Laravel Messenger
Notifying your users doesn't have to be a lot of work.
Stars: ✭ 135 (+40.63%)
Mutual labels:  laravel-5-package, package
video-downloader
Video Downloader for Facebook.
Stars: ✭ 63 (-34.37%)
Mutual labels:  package, laravel-5-package
Laravel Pdf
A Simple package for easily generating PDF documents from HTML. This package is specially for laravel but you can use this without laravel.
Stars: ✭ 79 (-17.71%)
Mutual labels:  laravel-5-package, package
Ui
React Styled Components with bootstrap grid system
Stars: ✭ 89 (-7.29%)
Mutual labels:  package
Awesome Nova
🎉 A curated list of awesome things related to Laravel Nova
Stars: ✭ 92 (-4.17%)
Mutual labels:  nova
Gargle
Infrastructure for calling Google APIs from R, including auth
Stars: ✭ 88 (-8.33%)
Mutual labels:  package
Laravel Package Maker
Get a 📦 skeleton and all other `make` commands from laravel base for package development.
Stars: ✭ 89 (-7.29%)
Mutual labels:  package
Flysystem Upyun
Laravel 又拍云文件存储,上传,删除。
Stars: ✭ 92 (-4.17%)
Mutual labels:  laravel-5-package
Laravel Nullable Fields
Handles saving empty fields as null for Eloquent models
Stars: ✭ 88 (-8.33%)
Mutual labels:  package
Laravel Single Session
This package prevents a User from being logged in more than once. It destroys the previous session when a User logs in and thereby allowing only one session per user.
Stars: ✭ 95 (-1.04%)
Mutual labels:  laravel-5-package
Ros tutorials
ROS Tutorials for beginner
Stars: ✭ 88 (-8.33%)
Mutual labels:  package
Laravel Enum
Simple, extensible and powerful enumeration implementation for Laravel.
Stars: ✭ 1,278 (+1231.25%)
Mutual labels:  laravel-5-package
Flex Env
🌳 Manage your .env file in Laravel projects through artisan
Stars: ✭ 95 (-1.04%)
Mutual labels:  package
Chartjs Chart Geo
Chart.js Choropleth and Bubble Maps
Stars: ✭ 94 (-2.08%)
Mutual labels:  map

Map Marker Field for Laravel Nova

GitHub (pre-)release Packagist GitHub license

Map Marker Field for Laravel Nova masthead image.

Supporting This Package

This is an MIT-licensed open source project with its ongoing development made possible by the support of the community. If you'd like to support this, and our other packages, please consider becoming a backer or sponsor on Patreon.

Requirements

  • Laravel 8.0+
  • Nova 3.9+

Installation

  1. Install the package:
composer require genealabs/nova-map-marker-field
  1. Publish the marker icon assets (this is not necessary if you are specifying your own):
php artisan vendor:publish --provider="GeneaLabs\NovaMapMarkerField\Providers\Service"

Implementation

To create the map marker field, all that is necessary is the form label, and the remaining options will have defaults applied:

use GeneaLabs\NovaMapMarkerField\MapMarker;

MapMarker::make("Location"),

Coordinate Field Names

By default the field will look for latitude and longitude fields on the model. However, if your model uses different names, you may customize them with the ->latitude('lat') and ->longitude('long') methods:

MapMarker::make("Location")
    ->latitude('lat')
    ->longitude('long'),

Default Settings

You can specify default settings for zoom level, and initial map center coordinates. If not specified, the zoom level will default to 12; the coordinates will default to (0, 0).

MapMarker::make("Location")
    ->defaultZoom(8)
    ->defaultLatitude(41.823611)
    ->defaultLongitude(-71.422222),

Center Circle

The optional centerCircle() method allows the addition of a circle to be rendered at the centerpoint of the map.

MapMarker::make("Location")
    ->centerCircle($radiusInMeters, $color, $borderWidth, $backgroundOpacity),

Search Provider

The underlying search capabilities are provided by leaflet-geosearch. Please refer to their documentation for provider configuration. By default we use the ESRI search provider.

MapMarker::make("Location")
    ->searchProvider('google')
    ->searchProviderKey('xxxxxxxxxxxxxxxxxxxxxxxxxxx'),

You can specify a custom search label in the geosearch box:

MapMarker::make('Location')
    ->searchLabel('Enter Address');

Tile Layer

You are free to use any tile provider that is compatible with Leaflet. Please refer to their documentation on tile layer URLs. By default we use tiles provided by OpenStreetMap:

MapMarker::make("Location")
    ->tileProvider('http://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png'),

Recenter On Nova Custom Component Events

  • From your custom component you can trigger the recentering of the map as follows:
    Nova.$emit("recenterMapOn", {latitude, longitude});
    
  • You can define a custom event name that the MapMarker field will respond to:
    MapMarker::make('Location')
        ->listenToEventName('customCenterEventTriggerName');
    
    You can then trigger the event from your custom component like so:
    Nova.$emit("customCenterEventTriggerName", {latitude, longitude});
    

Usage

When creating or editing you can search for an address or city to get the map to the general area you wish to get coordinates for. Then you can precisely position the marker by dragging the map -- the marker will always stay positioned in the middle, while you move the map under it.

When viewing the map in on the detail page, the map and marker are not interactive, and there is no search functionality. However, the user is free to zoom in and out.

Screenshots

Create / Edit Field

Screen Shot 2019-06-23 at 8 16 52 AM

Detail Field

Screen Shot 2019-06-23 at 8 17 43 AM

Index Field

Screen Shot 2019-06-23 at 8 32 01 AM

Commitment to Quality

During package development I try as best as possible to embrace good design and development practices, to help ensure that this package is as good as it can be. My checklist for package development includes:

  • ✅ Achieve as close to 100% code coverage as possible using unit tests.
  • ✅ Eliminate any issues identified by SensioLabs Insight and Scrutinizer.
  • ✅ Be fully PSR1, PSR2, and PSR4 compliant.
  • ✅ Include comprehensive documentation in README.md.
  • ✅ Provide an up-to-date CHANGELOG.md which adheres to the format outlined at http://keepachangelog.com.
  • ✅ Have no PHPMD or PHPCS warnings throughout all code.

Contributing

Please observe and respect all aspects of the included Code of Conduct https://github.com/GeneaLabs/nova-map-marker-field/blob/master/CODE_OF_CONDUCT.md.

Reporting Issues

When reporting issues, please fill out the included template as completely as possible. Incomplete issues may be ignored or closed if there is not enough information included to be actionable.

Submitting Pull Requests

Please review the Contribution Guidelines https://github.com/GeneaLabs/nova-map-marker-field/blob/master/CONTRIBUTING.md. Only PRs that meet all criterium will be accepted.

If you ❤️ open-source software, give the repos you use a ⭐️.

We have included the awesome symfony/thanks composer package as a dev dependency. Let your OS package maintainers know you appreciate them by starring the packages you use. Simply run composer thanks after installing this package. (And not to worry, since it's a dev-dependency it won't be installed in your live environment.)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].