1

I have used Leaflet in my web app for a while. And I studied the source code, but didn't find the code or function for sending HTTP request. If I missed the code, which part is for this function?

If it is not done in the Leaflet level, and how does it work? How does the Leaflet.js and server communicate with each other?

1 Answer 1

3

Here's where Leaflet "requests" the tile:

createTile: function (coords, done) {
    var tile = document.createElement('img');

It doesn't request the tile, it just creates an <img> element, and the browser does the actual request for the image source.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.