• Hi,
    I’m fearly new to WordPress (and websites…), so bear with me… ??
    I have created a simple page in WordPress and added this code to show a map with 1 green marker.
    [leaflet-map lat=”51.20877″ lng=”3.22393″ zoom=”12″ height=”800″ width=”100%” min_zoom=”5″ max_zoom=”18″ zoomcontrol scrollwheel]
    [leaflet-marker svg background=”#008000″ iconClass=”dashicons dashicons-star-filled” color=”white” lat=51.208768800134266 lng=3.223923841701351]

    I want to let visitors add more markers and store them in a database.
    I now that this is not a simple question but could someone sheld some light on this
    or direct me to some examples, probably one or more different so I can mix them together… I’m not looking for the code becayse I want to learn and do it myself but to have at least some jumpstart…

    some hurdles I need to take:
    – user click on the map and retrieve locations (lat lng)
    – store this in a database with a unique identifier and timestamp (so I can deleted undesirable markers…)
    – show them on the map, and show the unique identifier when clicked on it.

    Kind regards
    sorry no online website available yet…
    version Bitnami WordPress Stack 5.2.2

Viewing 1 replies (of 1 total)
  • Thread Starter chisop

    (@chisop)

    update:
    To retrieve the Lat and Lng, I’m using a workaround. I’ve placed on top of my site a link to https://www.latlong.net/ where the user can search the location and manually copy paste both values into the form…
    I’ve managed to create a form with the plugin “Contact Form 7” where a user can fill in the Latitude and Longitude (and some extra info not really related to Leaflet Map.)
    I’ve managed to store all submitted data from the form to a database with the plugin “Contact Form 7 Database Addon – CFDB7”.

    Now I “just” need to loop through all the records stored in a database, which I can see in phpAdmin, and add them as a marker to my Leaflet Map.

    Any advice to shorten my struggle…?

    Kind regards

Viewing 1 replies (of 1 total)
  • The topic ‘add markers by user’ is closed to new replies.