Cómo colorear el relleno de un país en el contorno de un mapa

Is it possible in Bing or Nokia maps to display a blank map of the world where each country is only outlined by its border, and then fill some countries with a solid color? Thanks!

preguntado el 30 de junio de 12 a las 19:06

2 Respuestas

Un blog on developer.here.com anunció que:

El API de geocodificador now supports the retrieval of admin boundary shapes (multi-polygon coordinates) with geocoding results. This feature is available for all countries & territories - in line with the country's depth of coverage.

El HERE Community Examples on GitHub offers a web-based example showing this. It is written in JavaScript but should give you the idea.

  1. Marca http request to the REST Geocoder service using the additionaldata=IncludeShapeLevel,[level], parámetro
  2. Analizar Well-known-Text format (WKT) using a regular expression.
  3. Take the coordinates and convert to Polygon

Now depending on your situation, on a phone you may prefer to offer digital fuera de línea. only support - because you know the maps are available directly from the device, so if you know for sure which regions you require it would make sense to pre-load the shapes based on a KML or GeoJSON file. If you don't know beforehand, your app relies on http anyway (or the potential set of locations is arbitrarily large) you may as well just http use REST geocoding for the regions you need.

By the way, one advantage of the online solution - because the Bing and Nokia Maps both use the same dataset as HERE, you can be certain that any shapes you download will match exactly.

Respondido el 13 de junio de 14 a las 08:06

You can render arbitrary polygons on top of Bing maps, but there's no built in functionality to render regions like provinces, states, counties, etc. In order to highlight a region you would need to provide all the points of a polygon and overlay it over a region on the map. Here's a great article that discusses drawing "advanced" polygon shapes with version 7 of the Bing Maps AJAX control.

“Advanced Shapes” (i.e. Donut Polygons) on Bing Maps

A possible duplicate question in regards to Bing maps API

Mapa de Bing: resalte el país con un polígono al desplazarse

contestado el 23 de mayo de 17 a las 12:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.