impress-org / google-maps-builder

One Google Maps plugin to rule them all. Google Maps Builder is intuitive, sleek, powerful and easy to use. Forget the rest, use the best.
https://wordpress.org/plugins/google-maps-builder/
32 stars 9 forks source link

Blank latitude and longitude causing random marker on the equator #116

Closed bamadesigner closed 7 years ago

bamadesigner commented 9 years ago

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.

screen shot 2015-08-29 at 1 40 43 pm

bamadesigner commented 9 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. :)

screen shot 2015-08-29 at 4 40 17 pm

kevinwhoffman commented 9 years ago

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?

sstruemph commented 8 years ago

@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

sstruemph commented 8 years ago

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:

  1. Edit the map and scroll down to the bottom to "Mashups".
  2. Click on "Mashup: 1"
  3. In the first dropdown field "Post Type" it is set to "Posts (post)" by default. Change this to "Pages (page)
  4. Scroll down and click "Load Markers". It will display errors in red. That is ok as they will be ignored.
  5. Publish the map. The unwanted marker should be cleared from the map. I have created a quick video showing my steps: https://www.dropbox.com/s/3mbirg9mxogvvee/maps-builder-clear-mashups.webm?dl=0"

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/

sstruemph commented 8 years ago

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.

sstruemph commented 8 years ago

@DevinWalker Any thoughts on this? I thought we had a workaround but it's no longer working.

DevinWalker commented 8 years ago

There needs to be a verification process that all markers have a lat/lng. I'm going to have to dive in and investigate.

kevinwhoffman commented 8 years ago

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.

sstruemph commented 7 years ago

Is there an update on this?

mathetos commented 7 years ago

@sstruemph We'll jump back on Maps Builder after we wrap up work on QuickCheckout. Hopefully sometime next week.

sstruemph commented 7 years ago

@mathetos I have a persistent customer who is asking about this again. Any update?

sstruemph commented 7 years ago

Here's the ticket: https://secure.helpscout.net/conversation/260774128/3995/?folderId=753630 The site URL: http://fastprintna.com/locations/

kevinwhoffman commented 7 years ago

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.

DevinWalker commented 7 years ago

Closing until more reports.