Reply To: Adding Mashup to PHP

Home Forums MapPress Support Adding Mashup to PHP 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%"]');
?>