cyberhobo / wordpress-geo-mashup

Official repository for Geo Mashup, the plugin that makes WordPress into a GeoCMS. Documentation:
https://github.com/cyberhobo/wordpress-geo-mashup/wiki/Getting-Started
63 stars 15 forks source link

Problem with creating a filtered map #781

Open carelostok opened 7 years ago

carelostok commented 7 years ago

Hi there, Geo Mashup is such a great plugin, thanks so much for all the work, you put in its development! I’m using it and it works for the better part. Everything works fine on the global map (https://www.urbaneoasen.de/) and also on the single-post-maps (e.g. https://www.urbaneoasen.de/project/planckgarten/).

But here’s my problem: I wanted to create a map where only posts related to a certain city are shown. The plugin offers the shortcode „locality=…“. So I put [geo_mashup_map post_type="project,event" map_content="global" locality_name="Dortmund"] on my page (https://www.urbaneoasen.de/staedte/dortmund). But the map doesn’t show all my posts, that are related to that locality. Why is that? Does anyone have a clue?

Alternative idea: I’m also working with taxonomies and terms. Every city is also a term oft he taxonomy „staedte“ (city in german). I could also change the shortcode into something like [geo_mashup_map post_type="project,event" map_content="global" taxonomy=“staedte“ term="Dortmund"]. But that shortcode doesn’t work. Am I missing something here?

I‘m using WordPress 4.7.2, Divi theme and different custum-post-types

I’d be glad for any hints. Carlos

anorupl commented 7 years ago

When it comes to second option with taxonomies and terms (tax_query). Currently only usable with template tags (not shortcodes).

(https://github.com/cyberhobo/wordpress-geo-mashup/wiki/Tag-Reference#query-variables)

tax_query - a taxonomy query array in the format used by WP_Query. Currently only usable with template tags (not shortcodes).

cyberhobo commented 7 years ago

Thanks Carlos, let's see if improved documentation could solve your problem. You may have noticed this sentence in the map tag reference:

Some fields, like locality_name and postal_code, will only work if reverse geocoding is enabled and the target objects have been successfully geocoded.

So the first question is, do you have Settings / Geo Mashup / Overall / Enable Reverse Geocoding checked? If so, was it checked when the locations you're mapping were saved?

Geo Mashup uses the GeoNames API for reverse geocoding. To make this reliable, it's best to register a GeoNames account and enter your username in Settings / Geo Mashup / Overall / Obscure Settings / GeoNames ID. (That isn't really an obscure setting, I made issue #782 to remove it).

Finally, you may want to try Settings / Geo Mashup / Overall / Bulk Reverse Geocode to get locality information for locations that may not already have it.

Let me know if this is helpful, and I'll add it to the current documentation.