WordPress.org

Ready to get started?Download WordPress

Forums

WP Flexible Map
[resolved] Loading with relative URL (2 posts)

  1. rotarypot
    Member
    Posted 1 year ago #

    hi!

    is it possible to use a relative URL to load the kml?
    ie,
    get_bloginfo('template_directory').'/maps/'.get_post_meta($post->ID, 'Mapfile', true);

    instead of say,
    'http://site.com/wp-content/themes/mytemplate/maps/map1.kml'

    Thanks :)

    http://wordpress.org/extend/plugins/wp-flexible-map/

  2. webaware
    Member
    Plugin Author

    Posted 1 year ago #

    G'day, if you're adding the map in code through a template, then yes you can, e.g.

    $kml = get_bloginfo('template_directory').'/maps/'.get_post_meta($post->ID, 'Mapfile', true);
    
    flexmap_show_map(array(
      'src' => $kml,
      'width' => 500,
      'height' => 400,
    ));

    If you're using the shortcode, then you'll need to filter 'flexmap_shortcode_attrs' to set the 'src' attribute that way.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic