Source: bojithapiyathilake.medium.com

Saving a Map Layer using LeafletJS, Laravel and MySQL.

Category: Laravel, MySQL, javascript

First let me lay out what I will be trying to demonstrate through this article.

At this point in time, I was using Laravel for the backend and blade/bootstrap for the frontend.

On line 57, the layer is added to the map and on line 58, we are saving the details of the layer to the input field. Now when we click on the submit button, the layer details will be sent to the Laravel controller as if it is a normal input and it can be saved to the database.

Now what we want to do is retrieve the layer from the database and input it to a leaflet layer which can be displayed on the map.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners