publiclab / leaflet-blurred-location

A Leaflet-based interface for selecting a "blurred" or low-resolution location, to preserve privacy
https://publiclab.github.io/leaflet-blurred-location/examples/
GNU General Public License v3.0
35 stars 32 forks source link

Cut down multiple API requests from Geocoding.js #186

Open rexagod opened 5 years ago

rexagod commented 5 years ago

Currently there are two different functions sending requests to the Maps API. We should look out for options to cut down this multiple use of the API.

https://github.com/publiclab/leaflet-blurred-location/blob/51744030cd0847a0309cbbc3354482e35e17a2aa/src/core/Geocoding.js#L7

https://github.com/publiclab/leaflet-blurred-location/blob/51744030cd0847a0309cbbc3354482e35e17a2aa/src/core/Geocoding.js#L111

// Jasmine logs
>> You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors. at
>> https:/maps.googleapis.com/maps/api/js?libraries=places&language=en&key=AIzaSyDWgc7p4WWFsO3y0MTe50vF4l4NUPcPuwE:128 th
>> You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors. at
>> https:/maps.googleapis.com/maps/api/js?libraries=places&language=en&key=AIzaSyDWgc7p4WWFsO3y0MTe50vF4l4NUPcPuwE:128 th
>> You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors. at
>> https:/maps.googleapis.com/maps/api/js?libraries=places&language=en&key=AIzaSyDWgc7p4WWFsO3y0MTe50vF4l4NUPcPuwE:128 th
>> You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors. at
>> https:/maps.googleapis.com/maps/api/js?libraries=places&language=en&key=AIzaSyDWgc7p4WWFsO3y0MTe50vF4l4NUPcPuwE:128 th
>> You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors. at
>> https:/maps.googleapis.com/maps/api/js?libraries=places&language=en&key=AIzaSyDWgc7p4WWFsO3y0MTe50vF4l4NUPcPuwE:128 th
jywarren commented 5 years ago

Ah, is this on local?

On Wed, Feb 20, 2019 at 3:08 PM Pranshu Srivastava notifications@github.com wrote:

Currently there are two different functions sending requests to the Maps API. We should look out for options to cut down this multiple use of the API.

https://github.com/publiclab/leaflet-blurred-location/blob/51744030cd0847a0309cbbc3354482e35e17a2aa/src/core/Geocoding.js#L7

https://github.com/publiclab/leaflet-blurred-location/blob/51744030cd0847a0309cbbc3354482e35e17a2aa/src/core/Geocoding.js#L111

// Jasmine logs>> You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors. at>> https:/maps.googleapis.com/maps/api/js?libraries=places&language=en&key=AIzaSyDWgc7p4WWFsO3y0MTe50vF4l4NUPcPuwE:128 th>> You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors. at>> https:/maps.googleapis.com/maps/api/js?libraries=places&language=en&key=AIzaSyDWgc7p4WWFsO3y0MTe50vF4l4NUPcPuwE:128 th>> You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors. at>> https:/maps.googleapis.com/maps/api/js?libraries=places&language=en&key=AIzaSyDWgc7p4WWFsO3y0MTe50vF4l4NUPcPuwE:128 th>> You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors. at>> https:/maps.googleapis.com/maps/api/js?libraries=places&language=en&key=AIzaSyDWgc7p4WWFsO3y0MTe50vF4l4NUPcPuwE:128 th>> You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors. at>> https:/maps.googleapis.com/maps/api/js?libraries=places&language=en&key=AIzaSyDWgc7p4WWFsO3y0MTe50vF4l4NUPcPuwE:128 th

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/publiclab/leaflet-blurred-location/issues/186, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJ7muTRZSO2NQUMRqrI5B15KH-BRYks5vPdVmgaJpZM4bGTkj .

rexagod commented 5 years ago

Yes, @jywarren, right after running grunt jasmine, even on the successful ones.