Git Product home page Git Product logo

bing-proxy's Introduction

GitHub version Build Status

bing-proxy is a Java proxy servlet for the retrieval of Bing™ Maps imagery metadata. The returned imagery metadata includes the urls and dimensions for imagery tiles, ranges of zoom levels, and imagery vintage information.

The latest version is 1.0.0, released on April 26, 2019:

Installation

Follow these steps for a stand-alone installation of the proxy servlet:

  1. Download the latest release of bing-proxy
  2. Deploy the war on your application server
  3. Insert your bing maps key in the web.xml

Prerequisites

The proxy servlet relies on an application server that is compliant with the servlet 3.0 specification. An example server that requires little to no configuration is Apache Tomcat. The supported versions are 7.0.x and higher.

The proxy servlet makes use of the Bing™ Maps API. The usage of this API requires a key. If you do not have one, read this page for more information. Basic keys are available at no charge that provide a limited number of transactions per year.

Configuration

bing-proxy adheres to the servlet 3.0 specification and uses the @WebServlet annotation to facilitate deployment. The servlet is registered under the name bing-proxy and mapped onto the url /bing.

Init parameters

The proxy servlet requires the presence of two init parameters (url and key) in your web deployment descriptor (web.xml). Failing to do so will result in a ServletException. Consider the following minimal configuration:

<servlet>
  <servlet-name>bing-proxy</servlet-name>
  <servlet-class>be.nepherte.bingmaps.BingProxyServlet</servlet-class>

  <init-param>
    <param-name>url</param-name>
    <param-value>http://dev.virtualearth.net/REST/v1/Imagery/Metadata</param-value>
    <description>the bingmaps metadata url</description>
  </init-param>

  <init-param>
    <param-name>key</param-name>
    <param-value>YOUR_KEY_HERE</param-value>
    <description>the bingmaps api key</description>
  </init-param>
</servlet>

Servlet mapping

To map the proxy servlet onto a different url, add a <servlet-mapping> to your web deployment descriptor (web.xml):

<servlet-mapping>
  <servlet-name>bing-proxy</servlet-name>
  <url-pattern>/bing</url-pattern>
</servlet-mapping>

Usage

The proxy servlet supports HTTP GET requests. It accepts the optional parameters mapType, culture and output. The default request looks like http://example.com/bing&mapType=Aerial&culture=en-US&output=json.

Map type

The mapType parameter specifies the type of imagery for which you are requesting metadata. Allowed values are Aerial, AerialWithLabels and Road. In the absence of this parameter, the servlet defaults to Aerial.

Culture

The culture parameter specifies the language and/or region to use. For an exhaustive list of supported values, see Supported culture codes. In the absence of this parameter, the servlet defaults to en-US.

Output

The output parameters specifies the format of the server's response to incoming requests. Allowed values are xml and json. In the absence of this parameter. the servlet defaults to json.

bing-proxy's People

Contributors

nepherte avatar

Watchers

 avatar  avatar  avatar

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.