Closed bamadesigner closed 7 years ago
I turned on clustering which helped me discover that, actually, 35 markers are being placed there so it seems that all posts who don't have the latitude/longitude info are being dumped in the Gulf of Guinea. :)
That's the location of 0, 0 lat/lng. So if the custom field is empty, it looks like it's defaulting to 0. Can we add a conditional to check if the lat/lng fields are unset and discard the marker?
@DevinWalker This was reported by a customer on this site: http://fastprintna.com/locations/
HelpScout ticket: https://secure.helpscout.net/conversation/260760204/3993/?folderId=672186
It looks like we found a workaround before:
This is what I had them do: "I have a workaround to clear out the unwanted Mashup markers. My hope is once they are cleared they won't show up again on that map. Below are the steps to clear them out. I tested this on my local test site and the markers were cleared from the map:
However she said it didn't work exactly that way:
Customer: "In the Post Type field, I tried to choose "pages (page)" first but it doesn't work. However, I choose "media" then, it works!"
HelpScout ticket: https://secure.helpscout.net/conversation/237990867/3208/
However now that workaround doesn't work on a different site. This is the same customer. She is using the new version 2.1.1. The workaround I posted above was with the previous version.
@DevinWalker Any thoughts on this? I thought we had a workaround but it's no longer working.
There needs to be a verification process that all markers have a lat/lng. I'm going to have to dive in and investigate.
I looked into this before and found a conditional here: https://github.com/WordImpress/Maps-Builder-Pro/blob/master/assets/js/frontend/google-maps-builder.js#L85-L88
// Make sure we have latitude and longitude before creating the marker
if (lat == '' || lng == '') {
return false;
}
The unwanted markers are appearing at coordinates 0, 0
on the map, however if lat
or lng
was 0
or ''
, then the condition would be met and the marker would not be created. Somehow these markers are getting past the conditional. Placing a console.log( lat );
before the conditional should offer some insight.
Is there an update on this?
@sstruemph We'll jump back on Maps Builder after we wrap up work on QuickCheckout. Hopefully sometime next week.
@mathetos I have a persistent customer who is asking about this again. Any update?
Here's the ticket: https://secure.helpscout.net/conversation/260774128/3995/?folderId=753630 The site URL: http://fastprintna.com/locations/
This appears to have been fixed way back in https://github.com/WordImpress/Maps-Builder-Pro/commit/e9ec21fd561a6ca45b4682c6d0c9ed33e6a356ae when a check for empty lat
and lng
was implemented.
I am unable to recreate it and it appears the customer's site mentioned above no longer displays the unwanted marker. Unless there's a more recent report of the issue, I suggest closing.
Closing until more reports.
I have a mashup marker group pulling from a CPT and one of my posts shouldn't have a marker because the post meta is blank but, instead, it's placing a marker quite randomly on the equator.