Lat / Lng Via Shortcode?

Home Forums MapPress Support Lat / Lng Via Shortcode?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #13883
    stratophile
    Participant

    Hello everyone,

    I can’t seem to find anything on this in the support forum — is it possible to create a map item, with desired attributes, then specify the latitude and longitude in the shortcode?

    Our WordPress records are generated via an external database (which is the primary repository for where our data is managed). At the moment, our database tracks the ID # of the associated MapPress item and inserts it into the generated HTML that is then inserted into the WordPress record. The problem with this approach is that whenever the coordinates are modified, we must manually update the MapPress item — increasing the likelihood of errors. We’d like to eliminate this from our daily workflow if possible.

    We’re using MapPress Pro.

    Any suggestions? Thanks in advance.

    #13885
    Chris
    Keymaster

    Hi,

    You can’t specify POIs info in the shortcode, but you can generate your maps automatically from the contents of custom fields.

    If you’re storing the lat/lng in custom fields in each post, the plugin can re-generate the map for you whenever the post is saved or those fields are changed. See the ‘geocoding’ section of the documentation for some information.

    #13887
    stratophile
    Participant

    Hi Chris – thanks for the response. What we’re trying to do, though, is avoid using the custom fields (that still requires us to make a separate update outside of the body of the page, thus still having a highly likely ‘disconnect’ between our database and WordPress; plus, from what I can tell, the custom fields don’t allow us to position the map where we want it).

    I guess our only option is probably to have our database directly do updates using the WordPress API — but that is something we’ve never done and do not know anything about. It’s likely to be several months before we can get around to implementing it – I was hoping to avoid that through the shortcodes.

    Out of curiosity, given all the flexibility you’ve built into the shortcodes, why is it not possible to specify a POI in it? Is there a technical limitation to shortcodes?

    Other than this limitation (for our purposes, anyway), the plugin is outstanding. Very handy.

    #13889
    Chris
    Keymaster

    Hi,

    The maps created with custom fields are like any other maps. They default to centering on the POI(s) but you can also adjust the center using the shortcode.

    There are no technical limitations regarding using a shortcode for POIs, although using custom fields ensures that geocoding is only done once rather than every page load (since you already have lat/lng coordinates that wouldn’t affect you). If you like you can post a feature request so others who are interested in this feature can request it too.

    #13890
    stratophile
    Participant

    Thanks, Chris — how do I position where the map object is placed on my page when using custom fields? Am I correct that this only works with the ‘top of page’ / ‘bottom of page’ settings? Or can I place it where I need it like I can with the shortcodes?

    #13891
    Chris
    Keymaster

    Just use the shortcode [mappress] and you can place it wherever you like. The plugin ignores the top/bottom setting if it sees a shortcode in the post.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.