WordPress.org

Ready to get started?Download WordPress

Forums

Pronamic Google Maps
[resolved] Shortcode for mashup? (9 posts)

  1. Miood
    Member
    Posted 1 year ago #

    Hi,
    I need to place mashup map on page using shortcode. Unfortunately it's only way for me to use this great plugin. I was trying to do this by modifications of "Pronamic_Google_Maps_Shortcode.php" but without good results. Please, help :-)

    http://wordpress.org/extend/plugins/pronamic-google-maps/

  2. Remco Tolsma
    Member
    Plugin Author

    Posted 1 year ago #

    In the next release we will add an [googlemapsmashup] shortcode. W'll try to launch it this week.

    [googlemapsmashup query="post_tpe=company&nopaging=true" map_type_id="satellite"]

  3. Miood
    Member
    Posted 1 year ago #

    Thank you for reply. Finally I did it and it works well.

    Btw, I have another question: Tell me please, how to display balloon after click on single post map and how to show the address in the balloon. I need to have the same effect, i did in mashup map: http://zooom.pl/screensnapr/1336408584-04tKxElrI2.jpg

    I did it by adding in Pronamic_Google_Maps_Mashup.php this code:

    function prefix_pgmm_item($itemContent) {
    	$itemContent = '';
    	$itemContent .= '<strong> ';
    	$itemContent .= '	<a href="'. get_permalink() .'">';
    	$itemContent .= '		'. get_the_title();
    	$itemContent .= '	</a>';
    	$itemContent .= '';
    	$itemContent .= '</strong>';
    	$itemContent .= wpautop(get_post_meta(get_the_ID(), '_pronamic_google_maps_address', true));
    	$itemContent .= wpautop(get_post_meta(get_the_ID(), '_pronamic_google_maps_description', true));
    	$itemContent .= '<hr size=1 noshade>';
    	$itemContent .= '	<a href="'. get_permalink() .'"><img src="http://MyUrl/wp-content/themes/Minimal/images/btn-zobacz-szczegoly.png" alt="" title="..." class="aligncenter" />';
    
    	return $itemContent;
    }
    
    add_filter('pronamic_google_maps_mashup_item', 'prefix_pgmm_item');

    How and which files should I change to do the same on single map?

  4. Remco Tolsma
    Member
    Plugin Author

    Posted 1 year ago #

    I did it by adding in Pronamic_Google_Maps_Mashup.php this code:

    You should not adjust plugin files, you can add the code to the functions.php file of your WordPress theme.

    How and which files should I change to do the same on single map?

    The following filter is applied to the description on a single map:

    add_filter('pronamic_google_maps_item_description', 'prefix_pgmm_item');

  5. Miood
    Member
    Posted 1 year ago #

    Thanks for your support.

    You should not adjust plugin files, you can add the code to the functions.php file of your WordPress theme.

    I know that, but I'm not a coder so I tried a lot of stupid things to make it works :) - now it's great.

    Btw: I had to add to the mashup file this code:

    { ob_start();
    $output_string = ob_get_contents();
    ob_end_clean();
    return $output_string;}

    Without it, mashup shows on the top of page and not where it should.
    Maybe it's a good idea to fix this problem with your new update?

  6. Remco Tolsma
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for the suggestion, that won't be a problem in our implementation of the mashup shortcode.

  7. Miood
    Member
    Posted 1 year ago #

    How to show different informations in a single map balloon and different in mashup map balloon?

  8. Remco Tolsma
    Member
    Plugin Author

    Posted 1 year ago #

    How to show different informations in a single map balloon and different in mashup map balloon?

    You can use the following filters for that as described earlier in this topic.

    add_filter('pronamic_google_maps_mashup_item', ...
    add_filter('pronamic_google_maps_item_description', ...
  9. Miood
    Member
    Posted 1 year ago #

    Thank You! It looks perfect now :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic