Skip to content

Instantly share code, notes, and snippets.

@cyberhobo
Last active December 15, 2015 23:09
Show Gist options
  • Save cyberhobo/5338358 to your computer and use it in GitHub Desktop.
Save cyberhobo/5338358 to your computer and use it in GitHub Desktop.
Custom Geo Mashup javascript to visit the first post at a marker when clicked. #wordpress-geo-mashup #geo-mashup
GeoMashup.addAction( 'selectedMarker', function( properties, marker, map ) {
var objects = GeoMashup.getMarkerObjects( marker );
if ( objects.length > 0 && GeoMashup.have_parent_access ) {
parent.location.href = properties.home_url + '?p=' + objects[0].object_id;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment