• Resolved CehWeb

    (@cabreroehijos)


    Hello,

    I have created a map with some markers (with custom icons), by using Leaflet: https://imgur.com/Uv7u6zV

    I would like to know if it is easy to add Geocoding (search by postal code) and Satellite view, using this plugin or how I could do it.

    Thank you.

Viewing 15 replies - 16 through 30 (of 46 total)
  • Thread Starter CehWeb

    (@cabreroehijos)

    Sorry, I opened “OpenStreetMap” and I have adjusted all of the locations (it’s different with Google Maps).

    Only problem now is edit the popup’s style, I will open a ticket in Avada Support.

    Well, and I have to read the links that you passed me in first message, for the geocoding implementation, I hope that it will be easy.

    Thread Starter CehWeb

    (@cabreroehijos)

    Hello, I followed steps to include geosearch in my map, and I think that I have achieved it, but I have one doubt, is it possible to adjust search settings?

    I mean, only search streets near to the markers or search only in one community.. something similar.

    If I search for a street in my city, I get results from another countries (California, Mexico…): https://imgur.com/3YKHpCR

    Plugin Contributor hupe13

    (@hupe13)

    You can adjust the settings: see https://smeijer.github.io/leaflet-geosearch/providers/openstreetmap

    If you want to search your markers on your map see https://leafext.de/en/doku/leafletsearch/

    Thread Starter CehWeb

    (@cabreroehijos)

    Hello,
    I want to search streets or postal codes.
    Where have I to include this code? Using WP Code plugin?

    I refer to:

    const provider = new OpenStreetMapProvider({
    params: {
    'accept-language': 'nl', // render results in Dutch
    countrycodes: 'nl', // limit search results to the Netherlands
    addressdetails: 1, // include additional address detail parts
    },
    });

    I have seen that I can limit by country, can I limit only by places in map (like ‘fitbounds’ or something similar)?

    And finally, I have modified parameter ‘retainZoomLevel’ from 1 to 0 in ‘geosearch.umd.js’, because when I click on a marker, it gets maximum zoom and I see grey map. It exists another parameter for doing zoom when clicking on a marker?

    Thanks.


    Plugin Contributor hupe13

    (@hupe13)

    Sorry, at the moment I’m rarely online, I don’t have time to answer your question sufficiently. It will take a while until I am online more.

    Plugin Contributor hupe13

    (@hupe13)

    I updated my example with some more options.

    Thread Starter CehWeb

    (@cabreroehijos)

    Hello,

    I have added:

                            "accept-language": "es", // render results in German
                            countrycodes: "es", // limit search results to Germany
                            addressdetails: 1, // include additional address detail parts

    And now I only get spanish results, I suppose that I can’t filter only results from Spain, right? (it includes Argentina, Ecuador…).

    And another question, can I zoom when searching?

    Thanks!

    Plugin Contributor hupe13

    (@hupe13)

    Your countrycodes option is ‘es’, so you should get results from Spain. Here is the documentation, I have not tested it.

    Thread Starter CehWeb

    (@cabreroehijos)

    Yes, I don’t know why now I get results from Spain, it works fine.

    And finally, how can I zoom when searching? With “retainZoomLevel” parameter?

    Plugin Contributor hupe13

    (@hupe13)

    Yes, I don’t know why now I get results from Spain, it works fine.

    Because of countrycodes: "es",. If you want to get results from other countries use their countrycode.

    It zooms to the search result with [leaflet-map zoom=xx] and retainZoomLevel: true,.

    Thread Starter CehWeb

    (@cabreroehijos)

    Hmm, if I put “retainZoomLevel:true” it makes stranger things.

    Plugin Contributor hupe13

    (@hupe13)

    Then I also do not know. See my example, read the documentation (search “Show result”) or ask the author.

    Plugin Contributor hupe13

    (@hupe13)

    I have read it again myself: see my webpage at the bottom.

    Thread Starter CehWeb

    (@cabreroehijos)

    If I add:

                map.addControl(search);
    			map.on('geosearch/showlocation', function(event){
      				map.setView([event.location.y, event.location.x], 17);
    				});

    i get an error:

    We encountered an error activating your snippet, please check the syntax and try again. Mensaje de error:?syntax error, unexpected identifier geosearch

    Plugin Contributor hupe13

    (@hupe13)

    Sorry, replace ' with ".

Viewing 15 replies - 16 through 30 (of 46 total)
  • The topic ‘Doubts about creating a new map’ is closed to new replies.