Forum Replies Created
-
AuthorPosts
-
Hi,
This may work: get the Google map object for the map, then use the ‘idle’ or ’tilesloaded’ event (they have a description in the API documentation):
mapp0.getMap(); google.maps.event.addListenerOnce(_gmap, 'tilesloaded', function() { alert('ready'); });Hi,
Sorry, I don’t understand the question. Are you asking how to save a map you generated? If so, it’s possible to save a map to a post. But it’s usually easier to just generate the map from custom fields in the post (or edit it there manually).
December 15, 2013 at 7:03 pm in reply to: AJAX error when saving POI with link (within quotes) in POI body #13942Hi,
In every case I’ve seen AJAX errors were cause by one of these issues:
– another plugin
– a theme
– a modified or corrupted wordpress file
– WordPress out of memory (very rare)Try to deactivate all other plugins – at the same time – and switch to a standard theme like 2013. If that doesn’t work, feel free to send me a login using the contact form and I’ll take a look.
You can try disabling panning, but then you will need to center the map yourself:
[mappress disableautopan="true"]
You could also just use a regular infowindow (which pans to fit) instead of the infobox (which centers the POI).
Hi,
If you’re using PHP you can get an array of all the maps for a post like this (1234 is the post ID):
Mappress_Map::get_post_map_list(1234);Each map will have a ‘pois’ array of POI objects. And each POI object will have a ‘point’ array with members ‘lat’ and ‘lng’. For example to print all the POIs:
$maps = Mappress_Map::get_post_map_list(1234); foreach ($maps as $map) { foreach ($map->pois as $poi) { echo "Lat: " . $poi->point['lat'] . " Lng: " . $poi->point['lng']; } }If you want every map in the system instead of every map for one post, you can use:
$maps = Mappress_Map::get_list();I hope that helps.
Hi,
There’s only one template, but you can get different output for mashups and individual posts by including an ‘else’ after you check if there’s a post for the current POI. For example, to print the body saved with the POI on individual maps:
if ($post) { ... } else { echo $poi->get_body(); }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.
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.
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.
Hi,
For the body you’ll need to modify template file map_poi.php, which is much like editing a WordPress template file. For the icons you’ll need to use a filter ‘mappress_poi_iconid’:
http://codex.wordpress.org/Function_Reference/add_filterHere’s a sample filter based on two categories. You will need an update to 2.40.8 before using it – email me for the update:
function myiconid($iconid, $poi) { if ($poi->postid) { if (has_category('cata', $poi->postid)) return 'blue-dot'; if (has_category ('catb', $poi->postid)) return 'purple-dot'; } return $iconid; } add_filter('mappress_poi_iconid', 'myiconid', 10, 2);December 1, 2013 at 2:59 am in reply to: The maps is not showed when I put shortcodes in Business Directory #13863Do other shortcodes work inside business directory pages? It sounds like an issue with that plugin, rather than with MapPress.
Perhaps the directory plugin is showing the post content without executing the shortcodes within it?
December 1, 2013 at 2:02 am in reply to: The maps is not showed when I put shortcodes in Business Directory #13861Hi,
That’s strange, are you able to edit maps in the post editor?
If so, try switching to a standard theme like twenty-thirteen and deactivating your other plugins to see if something is interfering with the shortcode.
If not, try reinstalling the plugin:
http://mappresspro.com/installPer our emails, I think this is resolved.
The mashup didn’t work because there was an incorrect query parameter: ‘post-type’ instead of ‘post_type’ in the template.
Hi,
Sure, I can log in, but I need the URL for your test site and a login (use the contact form or email me).
Hi,
Before you can generate a mashup, you have to have the maps.
Did the plugin create maps for your posts? If not try publishing them – maps are created when a post is updated or published. You should see a map named ‘automatic’ is created for each post.
Once you have the maps, use ‘post_type=any’ instead of ‘post_type=posts’, otherwise WP will not read your custom post types.
-
AuthorPosts
