zp_OpenStreetMap: Blank space

I tried a lot to get zp_OSM working following the instructions on github. Unfortunately, I did not have success for 2 weeks. I tried several themes (especially basic and libratus), put the printOpenStreetMap() in image.php (hopefully in the right place).
There is obviously some space reserved below the picture, but no map displayed (only blank background).

I could not find any errors in the logs, so I ask here for advice, maybe someone has a suitable "image.php" I can try with.

Thanks for any help
Hermann

Comments

  • fretzl Administrator
    Some obvious questions ;-)
    Is the plugin properly installed?(does it show up in the list of plugins?)
    Did you in fact activate/enable the plugin?
    Do you have a link to the site?

    Can you post the code you placed + some surrounding lines of code?
  • Hi fretzl, thanks for the quick reply.

    Is the plugin properly installed?(does it show up in the list of plugins?)
    --> Yes

    Did you in fact activate/enable the plugin?
    --> Yes, the box on the plugins list is ticked.

    Do you have a link to the site?
    --> Unfortunately not now, I'm using a virtual machine for testing.

    Can you post the code you placed + some surrounding lines of code?
    --> Here comes a snippet from libratus' image.php (about lines 63-81):

    `
    <?php if (getOption('libratus_social')) include ('inc-socialshare.php'); ?>

    <?php if ((function_exists('printGoogleMap')) || (function_exists('printOpenStreetMap'))) {
    if (function_exists('printOpenStreetMap')) {
    $map = new zpOpenStreetMap();
    if ($map->getGeoData()) {
    setOption('osmap_width','100%',false); // wipe out any px settings for plugin, flex set in css
    setOption('osmap_height','300px',false);
    printOpenStreetMap();
    }
    } elseif (function_exists('printGoogleMap')) {
    if (getGeoCoord($_zp_current_image)) {
    setOption('gmap_width',null,false); // wipe out any px settings for plugin, flex set in css
    setOption('gmap_height',300,false);
    printGoogleMap(gettext('Show Google Map'),null,'show');
    }
    }
    } ?>
    `
  • fretzl Administrator
    Thanks!
    About the installation of the plugin again: Is the folder zp_openstreetmap present in the /plugins folder?
  • acrylian Administrator
    You actually you don't need to check for geodata as the class method `printMap()` does this already, ,too. (counts for both plugins).

    Actually using the `printOpenStreetMap()` and optionally setting the parameters are needed should be enough. Setting the options everytime is not needed at all as you can set them on the backend.

    I heard reports about the map not showing up but so far I could not reproduce it. Make sure you have selected one of the OSM map tiles for testing. And of course there is not a big company behind OSM so sometimse their servers take a while.
  • Hi everyone,
    since I could not figure out what caused the problem, I did a fresh install on a real machine (not a virtual one), and everything is working perfectly.
    So thank you very much for the support; I hope I can help at anoter place.
  • acrylian Administrator
    Thanks for the feedback. Great it worked out finally. I hope I find time update the plugin to the latest leafletjs script soon.
Sign In or Register to comment.