Cargando mapa
consultax:SELECT SQL_CALC_FOUND_ROWS wp_posts.*, ROUND( ( 6371 * acos( cos( radians(pm_lat.meta_value) ) * cos( radians( 42.616714 ) ) * cos( radians(-1.612414) - radians(pm_lng.meta_value)) + sin(radians(pm_lat.meta_value)) * sin( radians(42.616714)))), 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 (11,49,55) ) 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 -2.9599123689779 AND -0.26491493102212 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 41.267415521024 AND 43.964227460105 GROUP BY wp_posts.ID ORDER BY `distance` ASC, wp_posts.post_date DESC LIMIT 0, 21