Forum Replies Created
-
AuthorPosts
-
Hi,
Maps are output in a table that also contains the directions and poi list. The 2012 theme applies a border to table rows – that’s the line you’re seeing, at least on my site.
You can find the actual class using Firebug (for Firefox) or IE Developer Tools, then remove it or override it.
Hi,
No not yet. WordPress doesn’t provide a mechanism for 3rd-party plugins to update so it will have to wait until I can write an update server to replace their functionality.
Hi,
The map is created and saved in the database so it doesn’t need to be geocoded on each request. This makes things much faster (geocoding can take 1 sec) and also helps to avoid Google’s per-day geocoding limits.
You can write the lat/lng values to a custom field by hooking into the ‘save’ action. I haven’t tested it, but code like this should write the first poi lat/lng to custom fields:
<?php function myaction($map) { global $post; $first_poi = isset($map->pois[0]) ? $map->pois[0] : null; if ($first_poi) { $lat = $poi->point['lat']; $lng = $poi->point['lng']; update_post_meta($post->ID, 'mylat', $lat); update_post_meta($post->ID, 'mylng', $lat); } } add_action('mappress_map_save', 'myaction', 10, 2); ?>Hi, I’m glad you got it working. I don’t know what a ‘wysiwyg’ field is, but it sounds like something from a fields plugin. Some plugins don’t write the data to WordPress custom fields, which is where it needs to be for MapPress to read it.
May 6, 2013 at 10:48 am in reply to: Add map shortcode to a template's tabbed content … not working #12502Hi,
1. No, the plugin writes the classes, you don’t need to do it
2. Probably because of #1
3. In the click function
Are you sure you can’t just use jQuery UI tabs? It would save you from having to reinvent this code which is already part of the plugin.
May 5, 2013 at 7:35 am in reply to: Add map shortcode to a template's tabbed content … not working #12492Hi Nick,
By default mapp0, mapp1, …etc indicate the first map on the screen, second, and so on. You can use the ‘name’ parameter in the shortcode to name your maps something else.
You’ll need to call that resize() function for each map inside the tab.
If you want to future-proof it, you could try searching for class ‘mapp-canvas’. Any <div> with that class will have as its ID the name of its corresponding map object. For example this should resize all maps on the screen:
jQuery(‘.mapp-canvas’).each(function() {
var id = jQuery(this).attr(‘id’);
var map = window[id];
map.resize();
}I don’t think degrees will work in MapPress. Are you asking about how to use Google maps?
May 4, 2013 at 5:15 pm in reply to: Add map shortcode to a template's tabbed content … not working #12487Hi,
That looks right, I’d say just move the resize below that last line.
Hi, you should be able to just enter the lat/lng as decimals (not degrees) in the map editor. You can also drag a POI to the correct location in the map editor if it seems to have picked the wrong spot.
Hi,
Sorry but no, the plugin doesn’t read or combine maps across sites.
No, I haven’t had a chance to look at it yet. I’ll let you know when I do.
May 3, 2013 at 4:11 am in reply to: Add map shortcode to a template's tabbed content … not working #12472Hi,
The template’s tabs are using jQuery – but they aren’t using the jQuery UI tabs library.
You’ll probably be better off just using the Post UI Tabs version. But if you or the template author want to edit the existing javascript, the command to ‘redraw’ the map is just as listed in the FAQ:
mapp0.resize();
You would need to put it inside the click() function in the code you provided.
May 2, 2013 at 10:50 am in reply to: Add map shortcode to a template's tabbed content … not working #12462Hi,
There is no solution or fix other than the workarounds outlined in the FAQ.
The browser reports hidden fields as having zero size, and the Maps API then draws only a small corner of the map. Google’s solution has been to offer a resize event you can trigger when a tab becomes visible.
I would suggest using jQuery UI tabs, or a plugin based on that library, in which case I have a workaround built in to MapPress that should work to trigger the resize event.
To instead continue using the existing tab control, you’ll need to trigger the map’s resize() method when its containing tab becomes visible. The ‘tab selected’ event depends on the control (and some don’t make one available at all).
Hi,
That’s an interesting one, I’m not sure but you might try removing the ‘return false’ – it cancels the normal event handling for the anchor (since normally there is no ‘#’ anchor), so it probably prevents moving the focus to your anchor.
Altenatively, you could use jQuery, to explicitly focus the anchor. For example:
mapp0.getPoi(10).open(); jQuery('#myanchor').focus(); return false;By the way, you can also modify the poi list template if you’d prefer to use that instead of the table plugin. It’s called ‘map_poi_list.php’ and there is some info in the documentation about how to copy it to your theme.
Hi Dan,
I’m glad you got it fixed! The Google Maps API only allows itself to be loaded once, so if the other plugin is loading that API you would need to disable it in order to run both plugins.
-
AuthorPosts
