Forum Replies Created
-
AuthorPosts
-
Hi,
There should be no impact from having many thousands of posts with a map – if you display the maps one at a time. But if you try to show all of the posts on the same mashup you’ll see a slowdown.
I would say for mashups it’s best to limit the query to a few hundred posts, although it’ll depend on your server, etc. You can avoid this by using the ‘posts_per_page’ argument in the mashup query to set the maximum posts to be read.
Hi,
The mashup is based on a query, so whenever you add new posts it will show them automatically – you don’t need to adjust the mashup, change it, or save it each time.
If you’re viewing the mashup in a web browser, you just need to refresh the page (using your browser’s refresh button) to run the query and see the new results.
Hi,
You’re right, there is no way to show a mashup of maps by map ID (all maps for all selected posts are displayed). However, you can do a mashup for specific posts, for example:
[mashup query="post__in=1,2,3"]If you use this, note the two underscores in ‘post__in’.
Hi,
Your theme is applying CSS that causes the map controls to distort. In bootstrap.min.css, it’s applying this CSS to all images:
img { width : 100% }You need to replace that with:
img { width: auto; }Or you can try to override for the map canvas by adding this to your styles.css:
.mapp-canvas img { width : auto; !important }Hi,
The plugin isn’t really meant to be used this way, so I can’t say if it’ll work, but one thing you might try is calling the map’s display() method, for example:
mapp0.display();You can see an example of that call in the regular map output script.
Hi,
Google has many features on Google Maps that they’ve chosen not to expose in the Maps API. Unfortunately marker titles is one of them. It is possible to do this by replacing Google’s markers with a custom overlay class (which would also speed up marker rendering), but I don’t have any ETA implement that yet.
Hi,
I don’t know, but that code worked fine for me. Check that you don’t have any typos. Also, it will only work for mashups – not for maps (since they don’t have any post content).
You can email me your entire template or post it here and I may be able to spot the error.
Hi,
Yes, you can modify the poi list template file (map_poi_list.php) to show the post content. Here’s an example where I’ve added it below the poi title:
<div class='mapp-title'> <?php echo $poi->get_open_link(); ?> </div> <div> <?php if ($poi->postid) { $post = get_post($poi->postid); echo $post->post_content; } ?> </div>Hi,
MapPress can generate maps from custom fields, but it’s really intended for use from the WP post editor or during data imports, not from PHP programs.
There are two problems with the code above:
1. It looks like you’re setting a variable $status to ‘publish’, not actually publishing the post.2. When post data (or status) is updated, try calling wp_update_post() to trigger the ‘save_post’ action. MapPress uses that hook.
You might also want to try get this working from the admin first, before trying to call it from a program:
1. Edit the post in the WP post editor
2. Set your custom fields
3. Publish to create the map.Hi,
Sorry, but I don’t know – I think it’s something unique to your site.
If you’d like to provide a URL or email me the source, I can try to spot it for you.
Otherwise, try starting from a simplified setup:
– deactivate ALL other plugins
– switch to a standard theme like 2014
– make your modificationThen reactivate to find where the problem lies.
If you do the above and it doesn’t work, you can also leave everything deactivated and send me a login, and I’ll try to take a look for you.
Hi,
There’s nothing built into the plugin for right/left list display, but you can edit the template file (map_layout.php). There’s some info on editing templates in the documentation.
If you’d like to provide an updated translation please email me and I’ll include it in the next release. The FAQ describes how to do it:
Hi,
Your code is fine – I just put it into my test site and it works to display the map. I think it may not be working for you because of a syntax error:
– Check that you’re not using ‘smart quotes’. Some software like Microsoft Word will replace a basic quote (“) with a fancy quote, which doesn’t work in PHP
Here’s a working copy from my test site – you could try copying and pasting this.
<?php $mymap = new Mappress_Map(array("width" => 600)); $mypoi_1 = new Mappress_Poi(array("title" => "Poscode KT17", "body" => "Epsom, Surrey", "point" => array("lat" => 51.34, "lng" => -0.24))); $mypoi_2 = new Mappress_Poi(array("title" => "Poscode KT18", "body" => "Epsom, Surrey", "point" => array("lat" => 51.31, "lng" => -0.26))); $mymap->pois = array($mypoi_1,$mypoi_2); echo $mymap->display(); ?>Hi,
Yes, that setting opens the first POI in the list and brings it forward above the other markers.
It’s not possible to open all the POIs at once as you asked earlier, nor are there marker labels. However, if you hover a marker with your mouse, you’ll see its tooltip (its title) if you’ve enabled tooltips in the settings.
Hi,
Sorry but no, only one POI can be open at a time (there’s only 1 infoWindow).
Hi,
This is really outside the scope of the plugin, so I can only offer some suggestions. But I think I can answer your questions:
1. You can detect a map move using javascript. You’ll need the map’s name – the default is ‘mapp0’ for the first map on the page and ‘mapp1’, etc. for subsequent maps. Or, you can use the ‘name’ parameter in the shortcode. Then use this code to get a handle to the Google Map object:
var map = mapp0.getMap();2. With the map handle you can register an event when the map bounds change (i.e. on a pan or zoom event). For example:
jQuery(document).ready(function() { var map = mapp0.getMap(); google.maps.event.addListenerOnce(map, "bounds_changed", function() { // Your code here, for example: var center = map.getCenter(); var zoom = map.getZoom(); }); });If you save the new center/zoom as metadata, you can probably use PHP to output a mappress shortcode with saved center/zoom.
For reference, the Google Maps API documentation is here:
https://developers.google.com/maps/documentation/javascript/reference -
AuthorPosts
