smeijer / leaflet-geosearch

A geocoding/address-lookup library supporting various api providers.
https://smeijer.github.io/leaflet-geosearch/
MIT License
1.03k stars 273 forks source link

LocationIQProvider is not exported #165

Closed wheercool closed 4 years ago

wheercool commented 6 years ago

Steps to reproduce: (from docs)

import { LocationIQProvider } from 'leaflet-geosearch';

const provider = new LocationIQProvider({ 
  params: {
    key: '__YOUR_LOCATIONIQ_KEY__',
  },
});

but LocationIQProvider is not defined

Heni-ghodbane commented 4 years ago

@smeijer I am interested to add more providers to this module. can you please describe the required steps we need to fix this issue. and the required changes to add new providers (@types and leaflet-geosearch). I have tried but I failed!

smeijer commented 4 years ago

@Heni-ghodbane what did you try exactly, and what failed?

I see that LocationIQProvider is indeed not being re-exported, but it should still be possible to import it directly from 'leaflet-geosearch/lib/providers/locationIQProvider.js', maybe that's something that this library should stimulate anyway, to reduce the bundle size.

At this moment, all (apparently minus LocationIQ) providers are included in the bundle. Which doesn't make sense when you only want to use one.

Heni-ghodbane commented 4 years ago

I have downloaded the project and the @types in order to fix that import problem, and as a next step I wanted to implement 2 other providers but I'm a little bit confused.

@smeijer I have just imported (Angular service) as you mentioned above and it works 👍

import locationIQProvider from 'leaflet-geosearch/lib/providers/locationIQProvider.js';

smeijer commented 4 years ago

The bug has been fixed in vNext, and will be released soon(ish).

@Heni-ghodbane , you've mentioned that you wanted to add more providers to the library. Which providers where you considering when you wrote that?

I can focus on writing instructions in the scope of #215 if your still interested.

Heni-ghodbane commented 4 years ago

@smeijer thanks for your comment, these 2 APIs: mapquestapi : http://www.mapquestapi.com/geocoding/v1/address?key=userKey&limit=5&location= openrouteservice : https://api.openrouteservice.org/geocode/autocomplete?api_key=userKey&text=

smeijer commented 4 years ago

Closing this issue as the ongoing discussion is out of context. @Heni-ghodbane, Can we continue the docs/provider discussion here? (As written there, I've updated the docs :slightly_smiling_face: )

smeijer commented 4 years ago

The export of the provider has been fixed in leaflet-geosearch v3, which has been released :tada: