Giter Club home page Giter Club logo

leaflet-control-bing-geocoder's Introduction

Leaflet Control Bing Geocoder

What is it ?

A simple geocoder that uses Bing to locate places.

How to use it ?

var cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
    cloudmade = new L.TileLayer('http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png', {attribution: cloudmadeAttribution});

var map = new L.Map('map').addLayer(cloudmade).setView(new L.LatLng(48.5, 2.5), 15);

var bingGeocoder = new L.Control.BingGeocoder('your-api-key');

map.addControl(bingGeocoder);

What are the options ?

You can specify an options object as a second argument of L.Control.BingGeocoder.

var options = {
    collapsed: true, /* Whether its collapsed or not */
    position: 'topright', /* The position of the control */
    text: 'Locate', /* The text of the submit button */
    callback: function (results) {
        var bbox = results.resourceSets[0].resources[0].bbox,
            first = new L.LatLng(bbox[0], bbox[1]),
            second = new L.LatLng(bbox[2], bbox[3]),
            bounds = new L.LatLngBounds([first, second]);
        this._map.fitBounds(bounds);
    }
};

Demo

Check out this page.

leaflet-control-bing-geocoder's People

Contributors

danzel avatar sa3m avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

leaflet-control-bing-geocoder's Issues

OpenStreetMap API instead of Bing

I know this is called leaflet-control-bing-geocoder but anyway I want to say that there is also a OpenStreetMap API for that. https://nominatim.openstreetmap.org/search/<query>?format=json... With this you don't need an access token and it is based on the same data like map itself.
If you don't consider that as a good idea, it would be better if you change http to https...
https://github.com/sa3m/leaflet-control-bing-geocoder/blob/master/Control.BingGeocoder.js#L78

input textbox on IPad and click button

First, thanks for your great job. That works very well on desktop.

However I got a problem on Ipad. I can't input anything inside the text box. I guess that's not because of your code. I have the same problem with a text box inside a custom leaflet control. You might have an idea on how to figure out that.

Cheers

Bing MAps geocoder must be used with Bing Maps layer

The Bing Maps geocoder must be used with the Bing Maps base map layers. It is fine to have Open Street Maps as an additional optional layer in your app, but Bing Maps must also be an option. This is a requirement of the Bing Maps terms of use.

Missing license

Since I've forked your repository and done some work on it, I'm interested in knowing under what license this code is distributed.

Most Leaflet plugins seem to use BSD 2 clause license, like Leaflet itself. Is this code also under this license?

Sorry if this feels like nitpicking.

Issue with IE8

Object doesn't support this action Control.BingGeocoder.js, line 35 character 3

35 submit.type = 'submit';

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.