3

I'm doing a project that will let users manipulate a map through LeafletJS, creating circles and polygons on top of the map. I need to gather these inputs for later analysis, using a MySQL database for the storing.

I was thinking in getting the input as geoJSON, then converting it into PHP by separating into several variables to correctly fill the tables in the database.

My question is more about where do I do that conversion... I imagine it is not everything on the client side right? I need to send the geoJSON to some back-end making the JSON-PHP conversion there, right? Or is there any other more direct way to do it?

  • Can you please post some code? – theNewArtist Dec 7 '18 at 14:22
3

Yes. You have to send your data from the client to the server and let server-code handle the database-insert.

You should look into HTTP POST through jQuery or other libraries as a way to asynchronously send your data from the client to the server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.