leaflet-vector-layers icon indicating copy to clipboard operation
leaflet-vector-layers copied to clipboard

JSON instead of JSONP?

Open dmeehan opened this issue 12 years ago • 4 comments

Is it possible to request JSON instead of JSONP? I am using LVL as a front end to a geoserver that is on my own domain, so I don't need the added complexity and potential security risk of JSONP.

Is there currently, or could there be added, a function that expects straight-up JSON?

dmeehan avatar Feb 07 '13 15:02 dmeehan

This is not currently an option, but it certainly makes sense in some situations. We could have an alternative to _makeJsonpRequest ... maybe _makeXhrRequest.

JasonSanford avatar Feb 07 '13 15:02 JasonSanford

I think that makes sense. I'm guessing it would not longer wrap the url in a script tag and would instead use something like jquery's getJSON() ?

dmeehan avatar Feb 07 '13 16:02 dmeehan

I probably wouldn't introduce/require any plugins, but would use the native XMLHttpRequest to get things.

JasonSanford avatar Feb 07 '13 16:02 JasonSanford

wondering if you've had a chance to further think about this. What I think could be really interesting is creating a simpler leaflet plugin by extracting the code you have already written that makes a new request to the server when the map moves, but also caches already rendered features so the entire set does not have to load. I'd be interested in helping with this if you can point me in the right direction.

Thanks!

dmeehan avatar May 19 '14 12:05 dmeehan