Support » Plugin: Geo Mashup » Get map’s iframe url

  • Resolved Sonika

    (@sonika)


    I am trying to show single map at popup/lightbox window

    But all maps can be get only as iframes.

    Example of iframe’s url:

    http://site.com/?geo_mashup_content=render-map&map_data_key=6b706ff427d0d3416c753760a2270417&height=250&width=730&add_overview_control=false&add_map_type_control=false&name=gm-map-1&object_id=4741&map_content=single

    Is it possible to get iframe’s url?
    Or to get map_data_key and object_id?

    I use provider openlayers

    Please, @cyberhobo, help!

    • This topic was modified 2 months, 3 weeks ago by  Sonika.
    • This topic was modified 2 months, 3 weeks ago by  Sonika.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Dylan Kuhn

    (@cyberhobo)

    That seems reasonable but unfortunately would be a new feature. The only current option would be to use the map content filter to strip the HTML and return only the URL.

    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 http://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="http://mysite.ru/?geo_mashup_content=render-map&map_data_key=be5e0b186f619fb99bcd339d5221c51e&map_content=global&center_lat=<?php echo $coords[lat]; ?>&center_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 2 months, 3 weeks ago by  Sonika.
    • This reply was modified 2 months, 3 weeks ago by  Sonika.
    • This reply was modified 2 months, 3 weeks ago by  Sonika.
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.