Chris

Forum Replies Created

Viewing 15 posts - 556 through 570 (of 1,120 total)
  • Author
    Posts
  • in reply to: Map Ready #13944
    Chris
    Keymaster

      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');
      });
      
      in reply to: Save PHP generated Map #13943
      Chris
      Keymaster

        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).

        Chris
        Keymaster

          Hi,

          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.

          in reply to: Panning to bottom #13918
          Chris
          Keymaster

            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).

            in reply to: MapPress Pro API? #13917
            Chris
            Keymaster

              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.

              in reply to: MapPress Show Date and Category on Mashup Pop Ups #13899
              Chris
              Keymaster

                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();
                }
                
                in reply to: Lat / Lng Via Shortcode? #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.

                  in reply to: Lat / Lng Via Shortcode? #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.

                    in reply to: Lat / Lng Via Shortcode? #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.

                      in reply to: customizing POI when map generated by custom fields #13874
                      Chris
                      Keymaster

                        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_filter

                        Here’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);
                        
                        Chris
                        Keymaster

                          Do 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?

                          Chris
                          Keymaster

                            Hi,

                            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/install

                            in reply to: Mashup query #13856
                            Chris
                            Keymaster

                              Per 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.

                              in reply to: Conflict with the latest EVENT CALENDAR by Tri.be #13855
                              Chris
                              Keymaster

                                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).

                                in reply to: Mashup query #13849
                                Chris
                                Keymaster

                                  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.

                                Viewing 15 posts - 556 through 570 (of 1,120 total)