Implement custom route for data request to prevent partial rendering of the page and it's possible issues (f.e. form captcha changes) (Close #49).

This commit is contained in:
David Molineus
2018-10-29 16:02:50 +01:00
parent 7ec2ee0d96
commit 0ba725ed38
14 changed files with 321 additions and 14 deletions

View File

@@ -138,7 +138,7 @@ L.Contao = L.Evented.extend({
* @param customLayer optional custom layer.
* @param map Pass a map object so that the data loading events are passed to the map.
*/
loadFile: function (url, type, options, customLayer, map) {
loadUrl: function (url, type, options, customLayer, map) {
var layer = omnivore[type](url, options, customLayer);
if (map) {
@@ -172,6 +172,19 @@ L.Contao = L.Evented.extend({
return layer;
},
/**
* Load data from an url into a layer using omnivore.
*
* @param url A file url.
* @param type The response content format.
* @param options Parser options
* @param customLayer optional custom layer.
* @param map Pass a map object so that the data loading events are passed to the map.
*/
loadFile: function (url, type, options, customLayer, map) {
return this.loadUrl(url, type, options, customLayer, map);
},
/**
* Point to layer callback. Adds a geo json point to the layer.
*