Git Product home page Git Product logo

laravel-leaflet-example's Introduction

Laravel Leaflet JS - Example

This is an example project for Leaflet JS and OpenStreetMap built with Laravel 5.8.

Laravel Leaflet JS Project Example

Features

In this project, we have an Outlet Management (CRUD) with localtion/coordinate point that shown in map. We also have coordinate entry with direct map pointing on Outlet Create and Edit form.

Installation Steps

Follow this instructions to install the project:

  1. Clone this repo.
    $ git clone [email protected]:nafiesl/laravel-leaflet-example.git
    # or
    $ git clone https://github.com/nafiesl/laravel-leaflet-example.git
  2. $ cd laravel-leaflet-example
  3. $ composer install
  4. $ cp .env.example .env
  5. $ php artisan key:generate
  6. Set database config on .env file
  7. $ php artisan migrate
  8. $ php artisan serve
  9. Open https://localhost:8000 with browser.

Demo Records

If we need some outlet demo records, we can use model factory within tinker:

$ php artisan tinker
>>> factory(App\Outlet::class, 30)->create();

Leaflet config

We have a config/leaflet.php file in this project. Set default zoom level and map center coordinate here (or in .env file).

<?php

return [
    'zoom_level'           => 13,
    'detail_zoom_level'    => 16,
    'map_center_latitude'  => env('MAP_CENTER_LATITUDE', '-3.313695'),
    'map_center_longitude' => env('MAP_CENTER_LONGITUDE', '114.590148'),
];

Please note that this is not an official or required config file from Leaflet JS, it is just a custom config for this project.

Testing

Run PHPUnit to run feature test:

$ vendor/bin/phpunit

License

This project is open-sourced software licensed under the MIT license.

laravel-leaflet-example's People

Contributors

aznadesign avatar dependabot[bot] avatar nafiesl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-leaflet-example's Issues

Want to know

Can i know what map you using? Is it Google map api or not?

How to add new layer and filter?

Hi Nafies.. thanks for this awesome project
I want to know how to add layer or filter based category like restaurant, hotel, etc on the same layer
Thanks

Laravel Upgrade to 6.x

This project currently using Laravel 5.8.*. I am offering someone to help to upgrade it to Laravel 6.x.

A pull request will be helpful for me.

Project update, now working with Laravel 10 and Vite

Hi there!
I've found this project very useful as a starting point to develop an app I'm working on it.
However, since it wasn't updated since long ago, I found very hard to run it locally in my computer, mainly because of lots of version conflicts with the modules used by it, both in "composer.json" and "package.json".
So then, after hours of trying and trying, I could make it work with the lastest versions of the used modules.

The only module I couldn't update is the SimpleCrudGenerator one, because it's lack of compatibility for Laravel 10.

I couldn't find the way to install it, even by trying this:
nafiesl/SimpleCrudGenerator@8534e0e

Despite I've been attempting a lot of different things, I kept on having the error showed here:
nafiesl/SimpleCrudGenerator#58

Since this module it was also developed by you, I think you may find a solution for this.

So then, I've uploaded the updated project into my Gitlab repo, now working in Laravel 10. I've added a couple of things in the README.md, explaining the kind of things I've been doing.
Here's the link:
https://gitlab.com/leandrocaplan/laravel-10-leaflet-example

I haven't updated the Leaflet version used in the project yet, but I think it would be a good idea for future commits.
If there's any suggestion for improving this updated version of the project, please let me know.

Hope you find it helpful!

Best regards
Leandro

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.