December 5, 2013 at 8:11 pm #13883
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.December 6, 2013 at 4:20 am #13885
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.December 6, 2013 at 8:02 am #13887
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.December 6, 2013 at 9:09 am #13889
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.December 6, 2013 at 9:17 am #13890
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?December 6, 2013 at 10:43 am #13891
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.
- You must be logged in to reply to this topic.