I've been keen to get this module to output some information that i can import into a google map using RSS feeds.

This is the function i've added to the cck_map.module file to add this functionality to feeds created using views. Any comments would be appreciated, or i can submit this as a patch if you're keen? It's makes a few assumptions, and i wasn't keen to use get_object_vars, but...


function cck_map_nodeapi(&$node, $op, $teaser = FALSE, $page = FALSE){
	if ($op == 'rss item'){
	  $fields = content_types($node->type);
		
		foreach($fields["fields"] as $field){
		  if($field["type"] == "map_location"){
		  	$n = get_object_vars($node);
		  	if($n[$field["field_name"]][0]["lat"] && $n[$field["field_name"]][0]["lon"]){
		  		return array(
      			array(
        			'key' => 'georss:point',
        			'namespace' => array('georss' => 'xmlns:georss="http://www.georss.org/georss"'),
        			'value' => $n[$field["field_name"]][0]["lat"]." ".$n[$field["field_name"]][0]["lon"]
        		)
      		);
      	}
		  }
		}
  }
  return array();
}	

This produces views that can be added to Google maps super easily.
Info on the georss standards etc

Comments

summit’s picture

Hi,

Does somebody have looked at this please?
Thanks a lot in advance!
Greetings,
Martijn