Thanks for answer, Dylan @cyberhobo!
In theory i understand, but i havent enougth knowlege for this…
I did, but I didnt understand only from where is map_data_key, bcoz i didnt fill it at admin area.
I took some code from here https://jsfiddle.net/GZBbk/
and did this way:
header.php
<script type="text/javascript" src="<?php bloginfo('template_url') ?>/scripts/jquery-1.js"></script>
<script type="text/javascript">
//<![CDATA[
$(window).load(function(){
$(document).ready(function() {
$('a.lnk').click(function(e) {
e.preventDefault();
var url = $(this).attr('href');
$('#realmap').attr('src', url);
return false;
});
});
});
//]]>
</script>
single.php
<?php if (function_exists('geo_mashup_map')) $coords = GeoMashup::post_coordinates(); if ($coords) { ?>
<?php if ( class_exists( 'GeoMashup' ) ) {
$current_location = GeoMashupDB::get_post_location( get_the_ID() );
if ( $current_location ) {
// The current post has a location, so include the map
$map_arguments = array (
'map_content' => 'global',
// 'map_content' => 'single',
'center_lat' => $current_location->lat,
'center_lng' => $current_location->lng,
'marker_select_info_window' => 'true',
'marker_select_highlight' => 'true',
'marker_select_center' => 'true',
'auto_info_open' => 'true',
'open_object_id' => $current_location->object_id
);
//echo GeoMashup::map( $map_arguments );
} } ?>
<a class="lnk" href="https://mysite.ru/?geo_mashup_content=render-map&map_data_key=be5e0b186f619fb99bcd339d5221c51e&map_content=global¢er_lat=<?php echo $coords[lat]; ?>¢er_lng=<?php echo $coords[lng]; ?>&marker_select_info_window=true&marker_select_highlight=true&marker_select_center=true&auto_info_open=true&open_object_id=<?php echo $current_location->object_id; ?>&name=gm-map-1&object_id=<?php echo $current_location->object_id; ?>"> Show map </a>
<iframe id="realmap" style="width:600px; height:280px;">load here</iframe>
<script type="text/javascript">
// tell the embed parent frame the height of the content
if (window.parent && window.parent.parent){
window.parent.parent.postMessage(["resultsFrame", {
height: document.body.getBoundingClientRect().height,
slug: "GZBbk"
}], "*")
}
// always overwrite window.name, in case users try to set it manually
window.name = "result"
</script>
<?php } //END if (function_exists('geo_mashup_map')) ?>
-
This reply was modified 5 years, 9 months ago by
Sonika.
-
This reply was modified 5 years, 9 months ago by
Sonika.
-
This reply was modified 5 years, 9 months ago by
Sonika.