WordPress.org

Ready to get started?Download WordPress

Forums

MapPress Easy Google Maps
[resolved] Adding links to map popups? - BasicGoogleMapsPlacemarks (6 posts)

  1. consumedesign
    Member
    Posted 2 years ago #

    The plug in is super nice compared to the complex and overdone other ones out there but I just want to add one simple thing. When you viewing the map, click on the placemarker, and add a link to the placemark's post... is this possible to do with a hack?

    http://wordpress.org/extend/plugins/mappress-google-maps-for-wordpress/

  2. chrisvrichardson
    Member
    Plugin Author

    Posted 2 years ago #

    Hi,

    Please post to the MapPress forums and I'll try to help you out:
    http://wphostreviews.com/forums

  3. consumedesign
    Member
    Posted 2 years ago #

    Thanks, just did a hack to the plug in... wish it was an option to add a link or not but this will work for what I need to do.

    Added to core.php:

    $placemarks[] = array(
    						'title'		=> $pp->post_title,
    						'latitude'	=> get_post_meta( $pp->ID, self::PREFIX . 'latitude', true ),
    						'longitude'	=> get_post_meta( $pp->ID, self::PREFIX . 'longitude', true ),
    						'details'	=> nl2br( $pp->post_content ),
    						'permalink'	=> get_permalink( $pp->ID ),
    						'icon'		=> is_array($icon) ? $icon[0] : plugins_url( 'images/default-marker.png', __FILE__ ),
    						'zIndex'	=> get_post_meta( $pp->ID, self::PREFIX . 'zIndex', true ),
    					);

    Then you can pull it back out in the functions.js with:
    line 116:

    createMarker : function( map, title, permalink, latitude, longitude, details, icon, zIndex )

    line 101:

    bgmp.createMarker( map, bgmpData.markers[m]['title'], bgmpData.markers[m]['permalink'], parseFloat( bgmpData.markers[m]['latitude'] ), parseFloat( bgmpData.markers[m]['longitude'] ), bgmpData.markers[m]['details'], bgmpData.markers[m]['icon'], parseInt( bgmpData.markers[m]['zIndex'] ) );

    I'm using it on a rel then with jQuery so I have in line 147:

    infowindowcontent = '<div class="bgmp_placemark" rel="'+ permalink +'"> <h1>'+ title +'</h1> <div>'+ details +'</div> </div>';
  4. consumedesign
    Member
    Posted 2 years ago #

    Opps this is for Basic Google Maps Placemarks, not sure why it posted on MapPress Easy Google Maps?

  5. bergblume
    Member
    Posted 2 years ago #

    mmmh.. unfortunately... I canĀ“t get the link work.

    I inserted in my functions.js

    infowindowcontent = '<div class="bgmp_placemark" rel="'+ permalink +'"> <h3>'+ title +'</h3> <div>'+ details +'</div>

    but no link (and if I use I get the URL of the current site - can s.o. help me to get the markers linked directly to the detailed placemarks site!

    thanky!

  6. consumedesign
    Member
    Posted 2 years ago #

    Oh you have to use jquery to allow the click->page... like:

    $('.bgmp_placemark').live('click', function() {
    	window.location = $(this).attr('rel');
    });

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic