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:
Follow these steps for a stand-alone installation of the proxy servlet:
- Download the latest release of bing-proxy
- Deploy the war on your application server
- Insert your bing maps key in the web.xml
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.
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
.
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>
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>
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
.
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
.
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
.
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
.