Answer the question
In order to leave comments, you need to log in
How to attach wordpress publication to google maps or yandex maps?
It is necessary to bind publications to a specific place on the map and display a google maps or Yandex map with all publications or with a selection by headings on a separate page.
Tell? is there a working plugin that does not require separately creating a shortcode for the point with further insertion into the post!
Answer the question
In order to leave comments, you need to log in
https://wordpress.org/plugins/yandex-maps-api/
https://wordpress.org/plugins/oi-yamaps/
All plugins are listed here: https://tech.yandex.ru/maps/jsapi/
var arr1 = [
{date:"2015-01-22", dog:1},
{date:"2015-01-22", cat:2},
{date:"2015-01-22", duck:3},
{date:"2015-01-22", duck:2},
{date:"2015-01-22", cat:3},
{date:"2015-01-22", dog:4}
],
arr2 = [];
for (var i = 0; i < arr1.length; i += 1) {
if (arr2[arr1[i].date] && arr2[arr1[i].date].date) {
for (n in arr1[i]) {
if (n !== 'date') {
arr2[arr1[i].date][n] = (arr2[arr1[i].date][n]) ? arr2[arr1[i].date][n] + arr1[i][n] : arr1[i][n];
}
}
} else {
arr2[arr1[i].date] = arr1[i];
}
}
console.log(arr2);
Here is the grouping function by common key: jsfiddle.net/n8qaf58g
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question