added bounds to keep view inside map

+ changed marker icon to works unified with cluster
This commit is contained in:
lenovo
2022-11-07 18:57:05 +01:00
parent 65ab0c455e
commit cfc747bad3
12 changed files with 243 additions and 55 deletions

View File

@@ -127,7 +127,7 @@ function mp_get_published_posts() {
return $posts_published;
}
function mp_fill_fields_value($id) {
function mp_fill_fields_value($post, $id, &$pays) {
/*
* get_field is an ACF function
@@ -153,7 +153,8 @@ function mp_fill_fields_value($id) {
);
$event = (object)[];
foreach($fields as $field) {
$event->$field = get_field($field, $id);
$value = get_field($field, $id);
$event->$field = $value;
}
// add mode irl or online (irl: true | false)
@@ -165,15 +166,16 @@ function mp_fill_fields_value($id) {
return $event;
}
function mp_get_published_events() {
function mp_get_published_events(&$pays) {
$posts_list = mp_get_published_posts();
$events = [];
foreach ($posts_list as $post) {
$event = mp_fill_fields_value($post, $post->ID, $pays);
$event->id = $post->ID;
$event->title = $post->post_title;
$event = mp_fill_fields_value($post->ID);
array_push($events, $event);
}
mp_console_log("nombre de posts: " . count($events));
return $events;
}