Chris

Forum Replies Created

Viewing 15 posts - 466 through 480 (of 1,120 total)
  • Author
    Posts
  • in reply to: Maps not centered on Safari Mobile #14753
    Chris
    Keymaster

      Hi,

      I think the map is centered, but the width is fixed at 425px, so you are only seeing part of the map on the smaller screen.

      Try using a % value for the width, like “50%”. Then the map will shrink as the screen gets smaller.

      in reply to: Map stopped working….. #14752
      Chris
      Keymaster

        Hi,

        Are you on a shared server? It looks like possibly Google has blocked that IP address for excessive usage or abuse:

        https://developers.google.com/maps/documentation/business/articles/usage_limits#http403

        If that’s the problem you can get a maps “API Key” in your Google account. That key will let Google tell your usage from others at the same IP address. You can enter the API key in the MapPress settings screen.

        in reply to: Adding Mashup to PHP #14712
        Chris
        Keymaster

          Ah, I forgot – the query isn’t parsed unless it’s run through a shortcode. You can try this query:

          $mymap = new Mappress_Map(array("query" => array('post_type' => 'any', 'posts_per_page' => -1), "center" => array("lat" => do_shortcode('[wpgc_latitude]'), "lng" => do_shortcode('[wpgc_longitude]')), "zoom" => 4, "width" => '100%'));

          But I think it’s easier to just use do_shortcode():

          <?php
          $lat = do_shortcode('[wpgc_latitude]');
          $lng = do_shortcode('[wpgc_longitude]');
          
          echo do_shortcode('[mashup query="all" center="' . $lat . ',' . $lng . '" zoom="4" width="100%"]');
          ?>
          in reply to: Adding Mashup to PHP #14708
          Chris
          Keymaster

            Add a query to your code to make it a mashup:

            $mymap = new Mappress_Map(array("query" => "all", "center" => array("lat" => do_shortcode('[wpgc_latitude]'), "lng" => do_shortcode('[wpgc_longitude]')), "zoom" => 4, "width" => '100%'));

            in reply to: Adding Mashup to PHP #14706
            Chris
            Keymaster

              Hi,

              Before you can do a mashup each post needs to have a MapPress map saved to it. From the code above, it looks like you’re generating the maps on the front end.

              If you don’t already have maps saved in each post, take a look at the MapPress geocoding settings. The plugin will let you generate a map automatically in each post based on the lat/lng custom fields (once you have it configured, save or publish the posts to create a map).

              Once the maps exist, you can use do_shortcode() to add a map or a mashup shortcode to the page.

              There are examples of using do_shortcode() in the documentation. For example, a simple mashup would be:
              `

              in reply to: mappress widget poi #14698
              Chris
              Keymaster

                Hi,

                Thanks, I understand now. The widget actually shows a mashup rather than a map. A mashup is a map that shows all the locations from the maps in one or more posts.

                There’s a radio button on the widget to select a default query or you can enter a custom query. You are probably seeing the POIs from the current posts (which is the default selection).

                To show just the map(s) from a specific post, enter the post ID or page ID in the query field like this (where 1234 is the post you want to show):
                p=1234
                or
                page_id=1234

                There’s more information on queries and mashups in the documentation:
                http://mappresspro.com/mappress-documentation

                in reply to: mappress widget poi #14691
                Chris
                Keymaster

                  Hi,

                  I’m sorry, but I didn’t understand the question. I see a map on that page in the sidebar. Are you asking how to show the same map using the MapPress widget?

                  in reply to: Ajax error after upgrading from 2.40.7 #14680
                  Chris
                  Keymaster

                    Hi,

                    The message didn’t give many clues about the source. I noticed some HTML from the infoWindow. Are you using a customized ‘map_poi.php’ file? There could be some code conflict there.

                    Here are some other things to try:

                    1) Check your PHP and Apache error logs to see what the original error was
                    2) AJAX errors are often caused by another plugin or theme – try deactivating ALL other plugins and switching to a standard theme for a moment and see if the error persists.

                    If that doesn’t help, please reactivate the latest version and send me an admin login using the contact form, and I can try to trace it for you.

                    Chris
                    Keymaster

                      Hi,

                      Are you using a map or a mashup?

                      WordPress has two types of functions: those that take a post ID and those that work on the global $post from The Loop. Usually the latter kind have ‘the_’ in the function name. A few functions can work either way (the post ID is optional).

                      For mashups, the POI list is generated using AJAX. During AJAX calls there is no The Loop, so functions based on the global $post won’t work.

                      For your situation it’s probably easiest to just use the functions that take a post ID:

                      <?php
                      	$postid = ($poi->postid) ? $poi->postid : $post->ID;
                      	$post_ = get_post($postid);
                      ?>
                      <?php if ($post_) :?>
                      <div>
                         <span><?php echo get_the_tag_list('', ', ', '', $post_->ID); ?></span>
                         <?php echo apply_filters('the_content', $post_->post_content); ?>
                      </div>
                      <?php endif; ?>
                      

                      If you must use the global $post functions, then you need to set up the global data before calling the function. For example:

                      <?php
                      	global $post;
                      	if ($poi->postid && $post_ = get_post($poi->postid)) {
                      		$post = $post_;
                      		setup_postdata($post);
                      	}
                      ?>
                      <?php if ($post_) : ?>
                      <div><?php the_tags();?></div>
                      <div><?php the_content();?></div>
                      <?php endif; ?>
                      
                      in reply to: SSL #14653
                      Chris
                      Keymaster

                        Hi,

                        MapPress uses the WordPress wp_upload_dir() function to get the icons directory (a subdirectory of the uploads directory).

                        There are several WordPress tickets to add SSL for that function but none seem to have been implemented yet:
                        https://core.trac.wordpress.org/ticket/25449

                        For now, you could try the ‘upload_dir’ filter (from WordPress file wp-includes\functions.php) to change the result of the wp_upload_dir() function. I haven’t tested it, but something like this might work (add it to your functions.php file):

                        function myfilter($uploads) {
                          $uploads['baseurl'] = str_ireplace('http', 'https', $uploads['baseurl']);
                          return $uploads;
                        }
                        
                        add_filter('upload_dir', 'myfilter');
                        

                        Alternatively, you could modify MapPress to hard-code SSL. Change this line in mappress_icons.php to set the correct URL:
                        $baseurl = $upload['baseurl'] . "/mappress";

                        in reply to: Mashup not linking to posts/pages #14645
                        Chris
                        Keymaster

                          That’s great, I’m glad you got it working!

                          in reply to: Mashup not linking to posts/pages #14640
                          Chris
                          Keymaster

                            Hi,

                            One problem is the syntax is wrong. The mashup should be:

                            <?php echo do_shortcode('[mashup query="all"]'); ?>

                            in reply to: add map widget to admin custom post types #14632
                            Chris
                            Keymaster

                              Hi, just select the check box for the custom post type on the MapPress settings screen (near the top).

                              in reply to: Mashup not linking to posts/pages #14624
                              Chris
                              Keymaster

                                Hi,

                                I’m not familiar with that theme so I don’t think I can do anything with the hook system, but I’ll be happy to take a look to see if there’s some other error. You can send your details through the contact form.

                                The plugin doesn’t substitute the post title or link the title for map POIs – only for mashups (where multiple posts are involved). To add a link to the title for a map POI you can use the map editor to set an anchor in the title itself. For example:

                                <a href='www.myblog.com'>Title</a>

                                Perhaps a workaround without using the hook system might be to use a separate template for the home page? Then you could just insert the mashup with do_shortcode() (see the documentation for examples).

                                in reply to: Auto zooming #14612
                                Chris
                                Keymaster

                                  Hi,

                                  I really can’t say, since it depends on your custom code. Are you sure it’s necessary to use custom code for this? It seems like you could just display a mashup with the additional 3 locations included from a map attached to a post.

                                  I can tell you that in general the map won’t autozoom/center if you provide a center or zoom parameter.

                                Viewing 15 posts - 466 through 480 (of 1,120 total)