Viewing 1 replies (of 1 total)
  • Plugin Author Remco Tolsma

    (@remcotolsma)

    You have to create some custom search form and an custom query.

    Pseudo code:

    if(function_exists('pronamic_google_maps_mashup')) {
    	$lat = $_GET['lat'];
    	$lng = $_GET['lng'];
    
    	$latLo = $lat - 0.25;
    	$latHi = $lat + 0.25;
    	$lngLo = $lng - 0.25;
    	$lngHi = $lng + 0.25;
    
    	$query = new WP_Query(array(
    		'posts_per_page' => -1 ,
    		'meta_query' => array(
    			array(
    				'key' => '_pronamic_google_maps_active',
    				'compare' => 'IN' ,
    				'value' => array('true', true, '1')
    			) ,
    			array(
    				'key' => '_pronamic_google_maps_latitude',
    				'compare' => 'BETWEEN' ,
    				'value' => array($latLo, $latHi)
    			) ,
    			array(
    				'key' => '_pronamic_google_maps_longitude',
    				'compare' => 'BETWEEN' ,
    				'value' => array($lngLo, $lngHi)
    			)
    		)
    	));
    
    	pronamic_google_maps_mashup(
    		$query ,
    		array(
    			'width' => 579 ,
    			'height' => 600
    		)
    	);
    }
Viewing 1 replies (of 1 total)

The topic ‘Add Search Option’ is closed to new replies.