• The shortcode API reference provides enough information for me to add a map to a page with a single marker included, like this:

    [mapsmarker lat=”43.26010702″ lon=”-71.03199977″ mapwidth=”100″ mapwidthunit=”%”]

    But if I add a second shortcode to the same page, with different values for lat and lon, it displays as a second map. Is there a way to add multiple markers to a single map, using shortcodes? I ask because I want to generate a map from an array of location data in php, and manipulating the shortcodes seems like it’d be the easiest way to do it

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,
    with that method you can currently only create single/marker maps – adding multiple markers to a map is currently not supported. This feature may be added with a future release, although other features are on the roadmap with a higher priority, so I cannot tell an exact release date.
    I would suggest having a look at the MapsMarker APIs instead, especially MMPAPI class, which could fit your needs – see details at mapsmarker.com/mapsmarker-api
    best,
    Robert

    Thread Starter mhann

    (@mhann)

    Hi, thank you for the clarification.

    https://www.mapsmarker.com/wp-content/uploads/mmpapi/#add_markers The MMPAPI class does seem like it will give me access to the functions I’ll need.

    So I’m trying to find the answer to this in the documentation, but I’m a bit lost: If I use add_markers() with an array of data, which I think I’ll be able to do with my data, what do I do with the output to make it display on a page? The example provided ends with “$markers = MMPAPI::add_markers( $markers_data );” So what do I do with that $markers variable to actually get them onto a map?

    Thread Starter mhann

    (@mhann)

    Never mind, I’ve made progress. Didn’t realize the marker functions were adding them directly to the database rather than holding them for an onscreen map

    ok – if you have any further questions, let me know!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Adding markers directly using shortcode?’ is closed to new replies.