I have a leaflet map on a html page I use to show certain geopositioned assets from my database.

One of the features uses nominatim reverse query for certain user actions. The actions that end in nominatim query are less than one per second, even less than one per minute.

It works perfectly when run on my localhost, and when run from a test server. But when I put my page on my sharepoint server all the nominatim queries end with a 429 Too Many Requests response.

The requests come from jQuery code executed on the browser, either firefox or chrome.

For simplifying and making the point, let's say that the code is run in a click handler of the map

  map.on('click', e=> {
    let popup = L.popup();
    reverseGeocode(e.latlng, res => {

and the reverse geocoding function just invokes the url with a jsonp wrap

function reverseGeocode(latlng,callback) {
    let url=`https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat=${latlng.lat}&lon=${latlng.lng}`;
    $.ajax({ url, 
      jsonp: "json_callback",
      success: callback

This code is in the page, and the page is in a private document library in my private sharepoint site hosted by microsoft office365 and accessed as xxxxxx.sharepoint.com

What can I do to solve this limitation?

asked 18 Dec '17, 10:19

P%20A's gravatar image

accept rate: 0%

edited 18 Dec '17, 12:23

So the Nominatim queries always originate from the user and not from the server?

(18 Dec '17, 11:35) scai ♦

I have updated my question with more information on the code

(18 Dec '17, 12:23) P A

In contrast to Firefox and Chrome, your sharepoint server likely does not send a HTTP referrer or user agent as requested by Nominatim's usage policy. You will need to consult the sharepoint documentation and/or contact your hoster to find out how to change that. Once a proper referrer/user agent is set, the error will go away.

permanent link

answered 03 Jan '18, 11:58

lonvia's gravatar image

accept rate: 41%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 18 Dec '17, 10:19

question was seen: 2,357 times

last updated: 03 Jan '18, 11:58

powered by OSQA