Git Product home page Git Product logo

magento2-module-map's Introduction

ElasticSuite Map

It allows to add map on the website.

How to use

  1. Install the module via Composer:

composer require smile/module-map

  1. Enable it:

bin/magento module:enable Smile_Map

  1. Install the module and rebuild the DI cache:

bin/magento setup:upgrade

How to configure

Stores > Configuration > Services > Smile Map > Map Settings

Field Type
Provider Select (OpenStreetMap/Google Maps)
Google API Key Text
Ipstack API Key Text
Google API Libraries Text
Google Map Styles Text
Directions Url Text
Marker Icon Image
Disable zoom out when no results Select (Yes/No)
Enable Marker Cluster Select (Yes/No)

Stores > Configuration > Services > Smile Map > Address templates

Field Type
Text Text
Text One Line Text
HTML Text
PDF Text

magento2-module-map's People

Contributors

afoucret avatar coosos avatar delyriand avatar fdec avatar ihorkvasnitskiy avatar livca-smile avatar oliverde8 avatar romainruaud avatar vfayard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

magento2-module-map's Issues

Markers are displayed in incorrect location of the map

Markers are displayed in incorrect location of the map

Preconditions

Magento Version :
2.4.3-p1

Module Map Version :
2.0.3

Environment :
developer

Third party modules :
smile/module-store-locator v2.0.7

Steps to reproduce

  1. Create retailer with latitude -30.289674 and longitude 153.119185, country - Australia.
  2. Navigate to stores list on FE

Expected result

  1. Store marker is displayed in correct location.

Actual result

  1. Marker is displayed in wrong place
    MNwK5yf
    After increasing zoom marker is displayed as expected
    qEh0V1S

Unable to resolve the source file

Browser console error appeared after navigating to storelocator search page
DevTools failed to load source map: Could not load content for https://domain.com/static/version1643874419/frontend/Magento/luma/en_US/Smile_Map/leaflet/plugins/markercluster/leaflet.markercluster.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

Preconditions

Magento Version :
2.4.3-p1

Module Map Version :
2.0.3

Environment :

Third party modules :
smile/module-store-locator v2.0.7

Steps to reproduce

  1. Navigate to store search page
  2. Open browser console
  3. Check warnings

Expected result

  1. No warnings and errors

Actual result

  1. Next warning appeared
    tpjESKO

Store search function work incorrectly on Shipping page

Preconditions

Magento Version : 2.3.3 (Commerce)

Module Map Version : 1.1.6 (in addition to store locator extension)

Environment : Production mode

Third party modules : Google Maps

Steps to reproduce

  1. We have available retailer addresses for country Australia
  2. Need to add product to cart
  3. go to checkout and to choose shipping method =Deliver my order in store=
  4. in popup need to enter postcode in search field
  5. click search

Expected result

1.Need to show all retailers that match postcodes

Actual result

1.Nothing happen

I think issue in file smile/module-map/view/frontend/web/js/geocoder-provider/google.js

Geocoder.prototype.geocode = function (queryText, options, callback) {
    if (geocoder === null && google && google.maps) {
        geocoder = new google.maps.Geocoder();
    } else if (geocoder === null) {
        throw __('Google Maps API is not ready yet.')
    }

    var request = {address: queryText, region: 'FR'};

    geocoder.geocode(request, function(results) {
        results = results.map(this.prepareResult);

        if (options['bounds']) {
            results = results.filter(function(result) { return options['bounds'].contains(result.location); });
        }

        callback(results);
    }.bind(this));
};

Where

var request = {address: queryText, region: 'FR'};

Why is region available only for France?

Argument 1 passed to Smile\Map\Model\Address::setRegion() must be an instance of Magento\Customer\Api\Data\RegionInterface or null, string given

We are busy upgrading from Magento 2.2.9 to Magento 2.3.3 and as part of this upgrade, we are upgrading our smile modules

The issue that we are having comes in with version 1.1.7 of magento2-module-map
where it seems this commit: c4bcb28 has been left out

That change was

  • introduced in 1.1.4
  • present in 1.1.5
  • present in 1.1.6
  • rolled back to the way it was in 1.1.3 when tagged in 1.1.7

This then creates the bug:

Argument 1 passed to Smile\Map\Model\Address::setRegion() must be an instance of Magento\Customer\Api\Data\RegionInterface or null, string given, called in src/vendor/magento/framework/Api/ExtensionAttribute/JoinProcessor.php on line 168

image

It is suggested that a new tag is created from master, because the class is correct in that branch (not sure on which branch the tag 1.1.7 was made)

We are on the below versions

            "name": "smile/elasticsuite",
            "version": "2.8.3",
--
            "name": "smile/elasticsuite-for-retailer",
            "version": "1.6.0",
--
            "name": "smile/module-elasticsuite-cms-search",
            "version": "2.2.6",
--
            "name": "smile/module-map",
            "version": "1.1.7",
--
            "name": "smile/module-offer",
            "version": "1.3.4",
--
            "name": "smile/module-retailer",
            "version": "1.2.9",
--
            "name": "smile/module-retailer-offer",
            "version": "1.5.1",
--
            "name": "smile/module-retailer-offer-inventory",
            "version": "1.0.1",
--
            "name": "smile/module-seller",
            "version": "1.2.6",
--
            "name": "smile/module-store-delivery",
            "version": "1.1.6",
--
            "name": "smile/module-store-locator",
            "version": "1.3.9.5",

Review the getAddressByLatLng function

OSM returns different data depending on the location of the longitude / latitude.
It is therefore possible that some value is not complete or incorrect

on clicking search, Map is loaded with zooming out recursively without showing expected result

on clicking search, Map is loaded with zooming out recursively without showing expected result

Magento Version : Magento 2.3.5

Module Map Version : 1.0.0

Environment : development

Third party modules :

Steps to reproduce

1.In the "FInd a store" section, enter the pincode or city name and enter the search
2.The Map is loaded with zooming out , showing entire world map instead of the exact location

Expected result

1.The map should show exact location of enter city name or pin code.

Actual result

  1. The map is zooming out,just showing the world map without exact location

leaflet_error

Maps unable to load

Preconditions

Magento Version: 2.2.2

ElasticSuite Version : 2.4.x

Environment: PHP 7.1.11

Third party modules: -

Steps to reproduce

Open store locator (Shop Search)

Expected Result

Maps loaded successfully without any errors.

Actual Result

screenshot 2018-01-12 08 15 24

Error in the console log:

Uncaught RangeError: Maximum call stack size exceeded
    at new o.latLng (leaflet.js:5)
    at UiClass.<anonymous> (map.js:276)
    at Array.forEach (<anonymous>)
    at UiClass.filterMarkersByBounds (map.js:275)
    at UiClass.refreshDisplayedMarkers (map.js:249)
    at e.fire (leaflet.js:5)
    at e.panBy (leaflet.js:9)
    at e._tryAnimatedPan (leaflet.js:9)
    at e.setView (leaflet.js:9)
    at e.setZoom (leaflet.js:5)

Attribution layer disabled for Leaflet

It seems that Leaflet gets configured with the attribution layer disabled. OSM requires sites using their maps to display a suitable copyright notice, which is normally handled appropriately by Leaflet.

Preconditions

Magento Version :

Module Map Version :

Environment :

Third party modules :

Steps to reproduce

  1. Make a map on your site
  2. View it.

Expected result

  1. Map should include correct attribution

Actual result

  1. You only see the map - no attribution

Enhancement : enable/disable the button "geolocalize me"

It would be great to enable or disable the frontend button to geolocalize the user.
It could be an improvement to add the security warning that geolocalizing in OSM can be activated only if SSL is on.
(the message is printed in the browser console on frontend)

thanks

Missing requirejs-config mapped Slick and promotionSlider

In the following file, Slick and promotionSlider are mapped, but are not included in the JS folder:

These dependencies were added in: a269848
But the JS files were later removed in: 15ba806

If the promotionSlider is no longer a part of the module, the following needs to be removed to avoid conflicts when requiring for example 'slick':

'slick'           : 'Smile_Map/js/lib/slick.min',
'promotionSlider' : 'Smile_Map/js/promotionSlider'

Preconditions

Module Map Version : 2.0.0 or higher

Remove dependency to Schedule and Store Locator

Enhancement : add the possibility to force specific countries on search

When you search using the box : postcode, city, state and if you type a postcode which is in more than one country, the map is zooming out on Europe level or word level.
For many stores, they are specific to one or more countries.
It could be great to have an option in backend to precise that we want the search focusing on some countries.
In OSM for example, we can already add the parameter countrycodes to specify the countries searched in.

thanks

Openstreetmap have changed their tile urls

When the map is displayed, the tile image domains are:

https://c.tile.osm.org/

as referenced in a few placed, among them,
https://github.com/Smile-SA/magento2-module-map/blob/master/view/frontend/web/js/map.js#L16
https://github.com/Smile-SA/magento2-module-map/blob/master/etc/config.xml#L24

This domain is no longer valid, and seem to have changed to

https://c.tile.openstreetmap.org/

as mentioned here: https://wiki.openstreetmap.org/wiki/Domain_names
This means the below errors will show in the console, and no map images loaded

image

Map does not work for exact addresses

Preconditions

Magento Version: 2.3.1 (Commerce)
Module Map Version: 1.1.6 (in addition to store locator extension)
Environment: Production mode
Configured provider: Google Maps

Steps to reproduce

  1. Go to stores page.
  2. Put not exact address related to the list of markers and click "Search".
    For instance, "Midland Highway, Kempton TAS, Australia"
  3. Check map behavior.
  4. Put exact address related to the list of markers and click "Search".
    For instance, "3121 Midland Highway, Kempton TAS, Australia"
  5. Check map behavior.

Expected result

The map is moved to corresponding area and related markers are displayed for both 3 & 5 steps.

Actual result

  • The map is moved to corresponding area and related markers are displayed for step 3.
  • The map is reset for step 5, all markers are displayed.

It looks like the extension expects to retrieve geometry.bounds for every result from Google Maps API during geocoding. In some cases it is not present, so the map is reset according to the current implementation. Probably geometry.viewport data could be used instead or as a fallback.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.