Coder Social home page Coder Social logo

nova-map-marker-field's Introduction

Nova Map Marker Field

This package allows adding fields with Mapbox, to select a location (by long - latitude).

This package is still under development, it is basicually functioning but not guaranted working perfectly or match multiple use cases

Prerequisite

This field requires attributes using the package MatanYadaev/laravel-eloquent-spatial

  • Nova ^4.x.x
  • Laravel 8+ (due to the dependencies of MatanYadaev/laravel-eloquent-spatial:2.x.x

Installation

  1. Composer package install
composer require takashato/nova-map-marker-field
  1. Put this to your configs/services.php
<?php
return [
  'mapbox' => [
    'public_token' => env('MAPBOX_PUBLIC_TOKEN'),
  ],
];
  1. Put your public access token of Mapbox to the .env file
MAPBOX_PUBLIC_TOKEN=<your_public_token>

The token is obtained from Mapbox Dashboard. Mapbox is free for 50k requests / mo but requires credit card for registration. You should consider for this.

Usage

NovaMapMarkerField::make(__('Field label'), 'attribute_name')
  ->hideFromIndex()
  ->zoom($zoomValue),
  • $zoomValue default zoom value of Mapbox (= 10 if empty)
  • attribute_name the attribute of current resource / model This attribute must implement an Point object by the package MatanYadaev/laravel-eloquent-spatial

Authors

  • me
  • (and may be you xD)

Contribution

Feel free to made PR or put an issue for this package. I will see for them when having free time xD

nova-map-marker-field's People

Contributors

takashato avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.