Pickup point map does not show markers for all points

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Hi,

Using Nopcommerce 3.8.

We have defined 21 pickup points with all correct address.

During checkout you can see the droplist of all 21 pickup points

However, on the map only the first 11 markers are displayed

So from the 12th pickup point in alphabetically order the markers are not display.

Does someone had this issue before?
and how can it be solved.

Thanks
Peter
6 years ago
Not sure how you're displaying markers on map, but geocode has some limit 10 to 11 requests per second. Check your code and add error status.
6 years ago
Hi,

We are just using the standard pickup point plugin from nopcommerce itself.
6 years ago
petervdm wrote:

We are just using the standard pickup point plugin from nopcommerce itself.


Thanks for the information.
I've generated same scenario at my end , and yes probably it's a bug!
First, try to add else condition and check what status do you get.

Goto: presentation > Nop.Web > Views > Checkout > OpcShippingAddress.cshtml
Line Number: 131 to 150
Add else condition.


if (status === google.maps.GeocoderStatus.OK) {
   ............
   ....

}
else {
       console.log(status)
}


Now run your application and goto pickup option page,
And check your browser console, if you get something like...



Then, it's exactly make my prediction right!
6 years ago
The reason that limit exists is to prevent abuse from Google's resources.

Possible solutions.

1. Use Google Maps Premier (paid) license that gives you 100,000 geocoding requests per day!

2. Store latitude/longitude from pickup point addresses while user entering it, and use it to display wherever you want!

3. If you're not interested in both of the above, modify your code

<text>
setTimeout( function () {
             geocoder.geocode({'address': "@address"}, function(results, status) {
                 if (status === google.maps.GeocoderStatus.OK) {
                     var marker = new google.maps.Marker({
                         map: googleMap,
                         title: "@point.Name",
                         position: results[0].geometry.location,
                         icon: "http://maps.google.com/mapfiles/ms/icons/blue-dot.png"
                     });
                     markers.set("@value", marker);
                     google.maps.event.addListener(marker, 'click', function () {
                         $('#pickup-points-select').val("@value")
                         infowindow.setContent("@pickupPointInfo");
                         infowindow.open(googleMap, marker);
                     });
                     @if (i == 0)
                     {
                         <text>googleMap.setCenter(marker.getPosition())</text> }
                     }
                     else {
                         console.log(status)
                     }
                  })
                 }, @i * 1000);
</text>


I've just added time delay between two request. please note it will take a bit longer time to display all the markers.

6 years ago
And done. You can see the changes in this commit.
Thanks for the suggestion and contribution.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.