[Plugin: Geo Mashup] Custom marker: post thumbnail
-
Hi there,
first of all Geo-Mashup is one of my favs! Great stuff!
Then, I’m having some troubles with setting my posts’ thumbnails as markers.
In my theme’s function.php I’ve added this:function lundici_geo_mashup_locations_json_filter( $json_properties, $queried_object ) { $post_id = $queried_object->object_id; $json_properties['lundici_marker'] = get_the_post_thumbnail($post_id, array(32,24)); return $json_properties; } //add_filter( 'geo_mashup_locations_json_object','lundici_geo_mashup_locations_json_filter', 10, 2 );
Then, once installed Geo-Mashup Custom plugin, I’ve added a custom.js file looking like this:
GeoMashup.addAction( 'objectIcon', function( properties, object ) { // Use a special icon, post's thumbnail object.icon.image = object.lundici_marker; } );
Instead of thumbnails, I get default GoogleMaps markers, not Geo-Mashup default markers: I’ve realized something gets broken in passing thumbnail names to custom.js, I’ve tried urlencoding (in PHP) and decoding (decodeURI, in javascript) image names but no success.
If I un-comment the add_filter call, I get no markers at all.What am I doing wrong?
Thank you for any help!
rash*
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘[Plugin: Geo Mashup] Custom marker: post thumbnail’ is closed to new replies.