Sha256: 98b9a8e554333a2f6f36fff49682ef177fbbaf32db2734bd203928c4b8f87a7b

Contents?: true

Size: 1.04 KB

Versions: 32

Compression:

Stored size: 1.04 KB

Contents

//= require vendor/l.control.geosearch.js

/**
 * L.Control.GeoSearch - search for an address and zoom to it's location
 * L.GeoSearch.Provider.OpenStreetMap uses openstreetmap geocoding service
 * https://github.com/smeijer/L.GeoSearch
 */

L.GeoSearch.Provider.OpenStreetMap = L.Class.extend({
    options: {

    },

    initialize: function(options) {
        options = L.Util.setOptions(this, options);
    },

    GetServiceUrl: function (qry) {
        var parameters = L.Util.extend({
            q: qry,
            format: 'json'
        }, this.options);

        return location.protocol
            + '//nominatim.openstreetmap.org/search'
            + L.Util.getParamString(parameters);
    },

    ParseJSON: function (data) {
        if (data.length == 0)
            return [];

        var results = [];
        for (var i = 0; i < data.length; i++)
            results.push(new L.GeoSearch.Result(
                data[i].lon,
                data[i].lat,
                data[i].display_name
            ));

        return results;
    }
});

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
flammarion-0.1.12 lib/html/source/javascripts/vendor/l.geosearch.provider.openstreetmap.js
flammarion-0.1.11 lib/html/source/javascripts/vendor/l.geosearch.provider.openstreetmap.js
flammarion-0.1.10pre2 lib/html/source/javascripts/vendor/l.geosearch.provider.openstreetmap.js
flammarion-0.1.10pre1 lib/html/source/javascripts/vendor/l.geosearch.provider.openstreetmap.js
flammarion-0.1.9 lib/html/source/javascripts/vendor/l.geosearch.provider.openstreetmap.js
flammarion-0.1.8 lib/html/source/javascripts/vendor/l.geosearch.provider.openstreetmap.js
flammarion-0.1.8pre1 lib/html/source/javascripts/vendor/l.geosearch.provider.openstreetmap.js
flammarion-0.1.8pre lib/html/source/javascripts/vendor/l.geosearch.provider.openstreetmap.js
flammarion-0.1.7 lib/html/source/javascripts/vendor/l.geosearch.provider.openstreetmap.js
flammarion-0.1.7pre2 lib/html/source/javascripts/vendor/l.geosearch.provider.openstreetmap.js
flammarion-0.1.7pre lib/html/source/javascripts/vendor/l.geosearch.provider.openstreetmap.js
flammarion-0.1.6 lib/html/source/javascripts/vendor/l.geosearch.provider.openstreetmap.js
flammarion-0.1.5 lib/html/source/javascripts/vendor/l.geosearch.provider.openstreetmap.js
flammarion-0.1.4 lib/html/source/javascripts/vendor/l.geosearch.provider.openstreetmap.js
flammarion-0.1.4pre lib/html/source/javascripts/vendor/l.geosearch.provider.openstreetmap.js
flammarion-0.1.3 lib/html/source/javascripts/vendor/l.geosearch.provider.openstreetmap.js
flammarion-0.1.2 lib/html/source/javascripts/vendor/l.geosearch.provider.openstreetmap.js
flammarion-0.1.1 lib/html/source/javascripts/vendor/l.geosearch.provider.openstreetmap.js
flammarion-0.1.0 lib/html/source/javascripts/vendor/l.geosearch.provider.openstreetmap.js
flammarion-0.0.14 lib/html/source/javascripts/vendor/l.geosearch.provider.openstreetmap.js