Store Locator distance markers and API requirements?

New home Forums Pro Add-on Pre-sale questions Store Locator distance markers and API requirements?

This topic contains 35 replies, has 2 voices, and was last updated by  Pm96 4 months, 3 weeks ago.

Viewing 15 posts - 1 through 15 (of 37 total)
  • Author
    Posts
  • #51282

    Pm96
    Member

    Hi,

    I came across your plugin and I am looking to make a sort of store locator but without the usual features such as Directions and StreetView. All it really has to do is find all “stores” (each store may have their own image on the marker but this is not important) in the country and search distance from a point and somehow retrieve the marker data e.g names of the markers than were filtered by the distance search into an array/list to be used in javascript functions. It also needs to be able to zoom in an out.

    Also importantly we may be planning on using the Google API and I am wondering if the project I described requires certain Google API’s to work? since as previously stated we don’t need to use Streetview/directions.

    Thanks,
    Phil

    • This topic was modified 4 months, 4 weeks ago by  Pm96.
    #51285

    Perry
    Moderator

    Hi there

    Thank you for getting in touch!

    Our plugin supports this use case – simply don’t enable directions, and disable street view in the settings menu. Our upcoming release (version 8) supports sorting by distance and distance display. We’re set for release this month, if you purchase before that then you can get a courtesy upgrade.

    We don’t directly support a JS array, but you can make use of our REST API if you need to fetch the raw data to work with.

    Our plugin only uses the necessary API’s. You can disable / restrict your API components as needed.

    Does that help?

    Kind regards
    – Perry

    #51287

    Pm96
    Member

    Thank you for quick response. This does help. So from what I understand that means the filtered/returned markers by distance hasn’t been implemented yet (I’m assuming this is visually or is it overall)? Storing the result markers from the distance search would have to be through the REST API and have to be custom code outside of the plugin?

    • This reply was modified 4 months, 4 weeks ago by  Pm96. Reason: forgot to mention visual assumption
    • This reply was modified 4 months, 4 weeks ago by  Pm96. Reason: Grammar
    #51291

    Pm96
    Member

    Just curious since this example: https://www.wpgmaps.com/demo/store-locator/ seems to filter at the bottom by distance ? It only shows the locations near the search for example

    #51306

    Perry
    Moderator

    Hi there

    Pro v7 does not support sort by distance or displaying distances, Pro v8 does. You could potentially adapt something yourself using the REST API if you wanted, or you could upgrade to v8 when it goes to release. If you purchased Pro v7 within 6 months of the (imminent) v8 release, you’ll be entitled to a free upgrade.

    Our demo shows all markers within the radius, but it doesn’t display any distance, or sort list items by distance.

    I hope that helps?

    Kind regards
    – Perry

    #51337

    Pm96
    Member

    Hi Perry,

    Thank you for the clarification. I think I’ll be able to sort something out with the rest API to get the data from the markers within the radius. I don’t think they necessarily have to get the distance of markers within the area just a list of the names of the stores which the marker identifies within the search radius.

    with appreciation,
    Philip

    #51338

    Perry
    Moderator

    Hi Philip

    Our store locator and marker filter already provides this functionality.

    If you enable the store locator then check out the network requests it issues, that will give you an example of how to query the REST API for markers within a radius.

    We can also provide an example request if needed.

    Does that help?

    Kind regards
    – Perry

    #51343

    Pm96
    Member

    Hi Perry,

    Yes that definitely helps that’s great news! I am assuming being able to search for a particular store is possible aswell? e.g user types in store name/address. The example request you mentioned would be very useful. Being able to implement each stores own logo on each marker is only possible with the pro version the description of the professional edition “Add different marker icons, or your own icons to make your map really stand out!” (assuming we need certain Google API for this if using in conjunction with google maps api?).

    Thanks,
    Philip

    #51344

    Perry
    Moderator

    Hi Philip

    It sounds like you are only running the basic plugin – You will need the Pro add-on if you want to add descriptions and enable searching on text fields.

    If you are happy to go ahead on that basis, please let us know, we can provide any code examples you need following your upgrade.

    If you do go ahead with that then thank you in advance for your purchase 🙂

    Kind regards
    – Perry

    #51355

    Pm96
    Member

    Hi Perry,

    Thank you again. I am trying to make a map and for some reason the store locator has 2 searches and I am confused about how to draw data filtered data.

    Also searching for Addresses froma radius and adding a marker in a specific address/post code isn’t working properly I am assuming I probably need the Google API to remedy this?

    I would really appreciate an example on the REST API on drawing data on the radius .

    Thanks,
    Phil

    #51356

    Perry
    Moderator

    Hi Phil

    Are you able to link us to your map page?

    Regarding the REST API, here’s how you would use JavaScript to retrieve all markers within 300 miles of California:

    var params = {
    center: {
    lat: 36.778261,
    lng: -119.4179323999
    },
    radius: 300
    };

    WPGMZA.restAPI.call(“/markers”, {
    data: {
    filter: JSON.stringify(params)
    },
    success: function(result, status, xhr) {
    console.log(result);
    }
    })

    Does that help?

    Kind regards
    – Perry

    #51357

    Pm96
    Member

    This is what is looks like I enetered an address (using bucking ham palace address) but no radius comes up or anything.

    Attachments:
    You must be logged in to view attached files.
    #51366

    Perry
    Moderator

    Hi Phil

    Unfortunately this is down to the geocoder used. Nominatim’s Geocoder (the one used with the OpenLayers engine) is nowhere near as accurate as Google’s geocoder.

    I’d recommend switching to the Google engine if you’re finding Nominatim insufficient, or possibly try removing the country restriction.

    Google do require that you set billing details in as of last year, but it’s very unlikely that you’ll exceed your monthly free request quota.

    Does that help?

    Kind regards
    – Perry

    #51368

    Pm96
    Member

    https://conassocstage.wpengine.com/test-map/ is the site where the map is hosted

    #51370

    Perry
    Moderator

    Hi Phil

    Thank you for that. Could you try disabling country restrictions?

    I’m typing in lots of different cities, some of these should definitely yield results.

    Kind regards
    – Perry

Viewing 15 posts - 1 through 15 (of 37 total)

You must be logged in to reply to this topic.