I’m using WordPress to build my website, i want to add a form that will have: name, description, image and location on a map. that is letting the users add their own marker on a map.
and by pressing ‘submit’ the whole data (name, description, image, longitude, latitude) would be saved to a database.
how can i do that? which plugins should i use?
You could use Google Placemarks and give them access to the creation of the ‘Placemarks’ custom post type that plugin utilises. You might have to hack the featured image..
Alternatively, you’re looking at full custom post type creation and google maps API integration, a custom loop that utilises of the featured image.
Plugin that comes closest to what you need is what SMacFadyen suggested – BGMP. But if you want to do that yourself you would need to look into this:
For the first one there is lots of tutorials on how to display map and InfoWindows so you shouldn’t have much problem with that. For Custom Post Types there is an awesome generator which should do 99% of your work. For Meta Boxes you can go several ways:
Several times, when searching how to make this work, I stumbled upon this thread. Every time, I wasn’t really happy with the way existing plugins deal with this. So, I now put this together myself.
Here’s an overview of my solution.
This should give you a map with all locations plotted out.
To allow users to add locations:
Depending on how you store your new location, on your next map reload, the new location will be included. (Or you perhaps need to authorise the new location, first.)
You can also reload all locations through AJAX.
Profile Builder allows you to do just that. Create a front-end register form including the required custom fields and a map field for users to pin or enter their location.
Then using the built-in User Listing (Member Directory) module, you can display a map of all users locations.