Cargando mapa
consultax:SELECT SQL_CALC_FOUND_ROWS wp_posts.*, ROUND( ( 6371 * acos( cos( radians(pm_lat.meta_value) ) * cos( radians( 39.614546 ) ) * cos( radians(2.911687) - radians(pm_lng.meta_value)) + sin(radians(pm_lat.meta_value)) * sin( radians(39.614546)))), 1 ) AS `distance` FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) LEFT JOIN wp_postmeta as pm_lng ON wp_posts.ID = pm_lng.post_id AND pm_lng.meta_key = 'property_longitude' LEFT JOIN wp_postmeta as pm_lat ON wp_posts.ID = pm_lat.post_id AND pm_lat.meta_key = 'property_latitude' WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (10) ) AND wp_posts.post_type IN ('estate_property', 'interesting_place') AND ((wp_posts.post_status = 'publish')) AND (SELECT meta_value FROM wp_postmeta WHERE meta_key='property_longitude' AND CAST(meta_value AS DECIMAL) AND post_id = wp_posts.ID GROUP BY post_id) BETWEEN 1.5641882310221 AND 4.2591856689779 AND (SELECT meta_value FROM wp_postmeta WHERE meta_key='property_latitude' AND CAST(meta_value AS DECIMAL) AND post_id = wp_posts.ID GROUP BY post_id) BETWEEN 38.266545193491 AND 40.965776659526 GROUP BY wp_posts.ID ORDER BY `distance` ASC, wp_posts.post_date DESC LIMIT 0, 21