JasonSanford / leaflet-vector-layers

A little help to viewing ArcGIS Server, Geocommons, Arc2Earth, CartoDB, GIS Cloud, etc. vector data in a Leaflet map
http://jasonsanford.github.io/leaflet-vector-layers
BSD 2-Clause "Simplified" License
216 stars 61 forks source link

JSON instead of JSONP? #33

Open dmeehan opened 11 years ago

dmeehan commented 11 years ago

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?

JasonSanford commented 11 years ago

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

dmeehan commented 11 years ago

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() ?

JasonSanford commented 11 years ago

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

dmeehan commented 10 years ago

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!