Skip Navigation

[Resolved] the map search only shows latitude and longitude when you use your location

This support ticket is created 5 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 8 replies, has 2 voices.

Last updated by Nigel 5 years, 8 months ago.

Assisted by: Nigel.

Author
Posts
#1266053

I am trying to: get the map search to work based on location

Link to a page where the issue can be seen: hidden link

I am trying to get the use my location to format as an address not coordinates.
Also when I search using the my location button it retrieves no results

<div id="fixed-width">
[wpv-filter-start hide="false"]
[wpv-filter-controls]
[wpv-control-distance compare_field="area" distance_center_url_param="toolset_maps_distance_center" distance_radius_url_param="toolset_maps_distance_radius" distance_unit_url_param="toolset_maps_distance_unit"]
[wpv-filter-reset output="bootstrap" class="reset-button"][wpv-filter-submit output="bootstrap" class="submit-button"]
[/wpv-filter-controls]
[wpv-filter-end]
</div>

[wpv-layout-start]
[wpv-items-found]
[wpv-geolocation]
[toolset-maps-distance-value origin_source='visitor_location' postmeta='wpcf-area']
[/wpv-geolocation]

[wpv-map-render map_id="map1" map_height="700px" cluster="off"][/wpv-map-render]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-map-marker map_id='map1' marker_id='marker2' marker_icon='//www.ecca.kldwebsites.com/wp-content/plugins/toolset-maps/resources/images/markers/Home.png' map_render='immediate' current_visitor_location='true'][/wpv-map-marker]
[wpv-map-marker map_id='map1' marker_id='marker1' marker_title='Name: [wpv-post-title]' marker_field='wpcf-area']Visit: [wpv-post-link][/wpv-map-marker]

<div id="fixed-width">
<div id="indv">
<h2>[wpv-post-link]</h2>
<p> [types field='email-contact'][/types]</p>
</div>
</div>

</wpv-loop>
<!-- wpv-loop-end -->

[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

#1266565

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Kyle

Regarding the search not working with coordinates, I didn't find that when I visited your page.

I used my location, which provided coordinates, and I had to expand the search radius (to 10000km; I'm in Europe) to see results, but it worked as expected. I had my colleagues test (from different areas of the world) who found the same.

Regarding your main issue, that "Use my location" returns coordinates rather than an address, that's because of how the browser Geolocation API works.

The "Use my location" button requests the user's location from the browser, and the browser returns its best guess as coordinates, not as an address.

It would be possible to follow-up the return of coordinates with a reverse address look-up from the Maps API (Google or Azure, whichever you are using) to request the closest address to those coordinates, but that is not an existing feature, and you would need to request such a feature using this form: https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

That could be problematic because the browser guesses your location but can easily be out by quite some distance, and the corresponding address may be quite different to the user's actual location.

#1266859

This makes sense, Thank you so much for explaining that!

#1266913
Screen Shot 2019-06-12 at 9.04.45 AM.png

Hi,
I went in and tried the same search parameters, but am still getting no results.
See attached screenshot.

#1267481

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

That's odd, I'm sure it was working yesterday.

Could I get access to your site and I can check the View set up and debug info?

I will mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site, even though I don't expect to make any changes.

#1273439

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I took a copy of your site to do some more testing, but I'm unable to identify the root of the problem, so I'm escalating this to my colleagues in second tier where they can debug further.

I'll keep you posted with what they find.

#1277817

Thanks Nigel, looking forward to getting this figured out. Let me know if you need anything else from me.

#1279477

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Kyle

Nothing needed from you, I'm still waiting on my colleagues to pin-point the source of the problem.

I tested the new Maps update to 1.8 to see if it fixed the issue by chance, but unfortunately not.

I hope to have an update for you soon.

#1279665

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Kyle

My colleague found on the copy of your site that removing then adding back the distance filter worked, if you could try the same.

So in the Search and Pagination section remove the markup and shortcodes for the distance filter.

Then in the Query Filter section above (if you cannot see it go to the Screen Options panel at the very top of the page and check the Query Filter option) delete the filter.

Now go back to the Search and Pagination section and start over inserting the distance filter again.

It's not clear how but it appears the current filter has been corrupted somehow.

Could you give that a try?