• Resolved dev_mapluz

    (@dev_mapluz)


    Hi
    I’m trying to display a map in a div tag OpenStreetMap of my wordpress page from an external page, I use the code below:

    require('../../../wp-config.php');
    $wp->init();
    $wp->parse_request();
    $wp->query_posts();
    $wp->register_globals();
    
    // do_shortcode
    $plug = '[osm_map
    lat="43.70657"
    long="-1.0562553"
    zoom="6"
    width="250"
    height="250"
    marker_file="http://localhost/wp/wp-content/plugins/hdimngs/resources/data/adresse.txt"
    type="AllOsm"
    map_border="medium solid blue"
    ]';
    echo do_shortcode($plug);

    The border of the map is displayed correctly but I do not have the content: icons, map drawing, knurr, ….

    Remark : Yet if I put the code above (from the line ‘/ / do_shortcode’) directly into a wordpress page it works well

    Do you have an idea ?

    thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • MiKa

    (@photoweblog)

    Did you try a map without any marker_file?
    Did you try a map without any marker_file directly with the OSM Plugin interface?
    BR photoweblog

    Thread Starter dev_mapluz

    (@dev_mapluz)

    hi
    yes without marker_file it is the same problem;
    but i have not used OSM_displayOpenStreetMapExt function.

    so i can run the do_shortocode with the openstreetmap plugin in a php page
    with the code

    <div id="osm">
    <?php
    $plug = '[osm_map
    lat="43.70657"
    long="-1.0562553"
    zoom="6"
    width="250"
    height="250"
    marker_file="http://localhost/wp/wp-content/plugins/hdimngs/resources/data/adresse.txt"
    type="AllOsm"
    map_border="medium solid blue"
    ]';
    echo do_shortcode($plug);
    ?>
    </div>

    the problem is finaly how to refrech a div with a do_shortcode on OpenStreetMap plugin ?
    in fact a process update my marker_file and in the follow instruction i want to refrech a div in javascript ! i have tested with jquery.ajax and set setTimeout function but the div is not refresh!

    thanks for your help

    Thread Starter dev_mapluz

    (@dev_mapluz)

    hi
    i have resolved my problem with this code :

    jQuery('#searchcarte').load("osm.php" );

    and the osm.php file contents this :

    <script src="http://www.openlayers.org/api/OpenLayers.js" type="text/javascript" />
    <script src="http://www.openstreetmap.org/openlayers/OpenStreetMap.js" type="text/javascript"/>
    <script src="http://localhost/wp-content/plugins/osm/js/osm-plugin-lib.js" type="text/javascript"/>
    
    <?php
    require('../../../wp-config.php');
    $wp->init();
    $wp->parse_request();
    $wp->query_posts();
    $wp->register_globals();
    $markerfile = "http://localhost/resources/data/adresse.txt";
    $plug = '[osm_map
    	lat="43.658966"
    	long="-1.256856"
    	zoom="6"
    	width="250"
    	height="250"
    	marker_file="'.$markerfile.'"
    	type="AllOsm"
    	map_border="medium solid green"
    	]';
    echo do_shortcode($plug);
    ?>

    Thank for your help

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘do_shortcode with osm’ is closed to new replies.