wordpress-geo-mashup
wordpress-geo-mashup copied to clipboard
Markers in Global map is not work with active plugin Polylang
Geo Mashup 1.6.2
Polylang 1.1.2
If Polylang active than global map is show just map, without markers. Problem
with languages.
Original issue reported on code.google.com by [email protected] on 16 Jul 2013 at 7:11
Thanks for noting the incompatibility. Let us know if you find a workaround.
Original comment by [email protected] on 16 Jul 2013 at 7:49
- Changed state: Accepted
- Added labels: Type-Incompatibility
I found that problem with geo mushup plugin. Because if I set option "Include
Taxonomies - Categories" (Makes legends, colors, and other features available)
and after set colors for categories then I see problems.
It is connected somehow with the languages. I dont know how...
Original comment by [email protected] on 16 Jul 2013 at 8:18
There is a similar incompatibility with WPML in issue 623 that has a workaround
- perhaps something similar would work with polylang.
Original comment by [email protected] on 16 Jul 2013 at 8:34
May be... I asked in your issue about your workaround. Please get an answer for
me
Original comment by [email protected] on 16 Jul 2013 at 8:40
Thank you. But Polylang dont have this option.
I dont have workaround now...
Original comment by [email protected] on 16 Jul 2013 at 8:56
Hello,
I am not sure why this happen...
However a workaround (that works for me), is to install "Query Monitor".
After activating it I do not have any problems (but the Include taxonomies
options still does not work)
Original comment by [email protected] on 11 Mar 2015 at 8:22
Hi,
Just stumbled to this problem, I think (atleast the global map isn't loading :). Unfortunately, I can't really JS, but if anyone's interested in this problem, here's the error that appears on page with global map.
TypeError: Cannot read property 'color' of undefined 5 wp-content/plugins/geo-mashup/js/taxonomy.js?ver=1.8.4:413:50 4 wp-content/plugins/geo-mashup/js/taxonomy.js?ver=1.8.4:413:50 Object.jQuery.extend.term_manager.term_manager.extendTerm() 3 wp-content/plugins/geo-mashup/js/geo-mashup.js?ver=1.8.4:708:31 Object.GeoMashup.addObjects() 2 wp-content/plugins/geo-mashup/js/geo-mashup-mxn.js?ver=1.8.4:743:8 Object.GeoMashup.createMap() 1 ?geo_mashup_content=render-map&map_data_key=fb481e522fe732bff6e2e0589dfa4275&lang=fi&object_id=871&map_content=global&name=gm-map-2:39:11
However, in my use case, I was able to achieve the same end result with manually adding categories, for example [geo_mashup_map map_cat="9,11"], instead of using [geo_mashup_map map_content="global"].
Hello,
I like geomashup. A great plugin which can do everything !
I have the same issue. Geomashup works very well but i can’t display a map if i activate translation with polylang.
Is it solved or do i need to use an other map plugin ?
I’ve tested a lot of thing and could not find a solution.
In console, i have this error :
TypeError: undefined is not an object (evaluating 'term_properties[taxonomy].terms[term_id].color')
Here is how i display map in template:
<?php echo GeoMashup::map('map_content=global&map_cat=planete') ?>
The map is ok in a language (FR) but if i translate a post it doesn’t work anymore.
Best regards,
Sébastien
@vinylroads , if you can give me a URL where I can see the issue that would help me at least determine a next step. Alternately, posting the arguments to the GeoMashup.createMap( ... ) call in the map frame here would be useful.
Hello, @cyberhobo @vinylroads Have you found any solution for Polylang issue? There's a problem with global map. Contextual map is working well.
Sorry, on this project that required polylang, i gave up and built my own custom map with custom type + ACF.
i've edited the wp-content/plugins/geo-mashup/js/taxonomy.js file.
changed at line 413
if ( term_properties[taxonomy].terms[term_id].color ) { color_name = term_properties[taxonomy].terms[term_id].color; } else { color_name = GeoMashup.color_names[ loaded_taxonomy.term_count % GeoMashup.color_names.length ]; }
to
color_name = GeoMashup.color_names[ loaded_taxonomy.term_count % GeoMashup.color_names.length ];
and removed the if statement at line 468
if ( term_properties[taxonomy].terms[term_id].line_zoom ) { max_line_zoom = term_properties[taxonomy].terms[term_id].line_zoom; }
of course i did this in the min.js file ...
after this changes the map works with polylang!
Hello @eliazu; I tried it, It seems working but this time global map shows not only active language, all of language items. Unfortunetally it means it's not a true solution.
Hello @cyberhobo Polylang is one of the popular and free multilang plugin. It would be great to implement with Geo-Mashup. Actually it's working with Contextual Map. As I observed just "Global Map" and "Nearby List" have a problem with Polylang.
@Birtakimseyler it works for me. for all languages. the English page, with code that query X last posts, queries only English places. the french page, with code that query X last posts, queries only french places.
maybe you put the code not in a page with language defined, or you queried wrong posts languages or undefined languages.
@eliazu Yes you're right. It could be solved in the the queries. I did not used like that. But still there's a problem with "Nearby list". Did you already found another solution about that?
Thank you!