-1

I am trying to use bing map to search location city and zip codes for Denmark(DK).

But some times it is not working property. I have tried using the following code with SDK:

var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {
    credentials: 'Your Bing Maps Key',
});

var geoDataRequestOptions = { entityType: 'PopulatedPlace' };

Microsoft.Maps.loadModule('Microsoft.Maps.Search', function () {
    var searchManager = new Microsoft.Maps.Search.SearchManager(map);
    var requestOptions = new Microsoft.Maps.Search.GeocodeRequestOptions();
    requestOptions.bounds = map.getBounds();
    requestOptions.where = "1011 København K, DK";
    requestOptions.callback = function (answer, userData) {
        map.setView({ bounds: answer.results[0].bestView });
    };
    searchManager.geocode(requestOptions);
});

I also tried to search "1011 København K, DK" with bing map on https://www.bing.com/ its not working perfactly for me.., where as some times it working fine that is if i have search "1052 København K, DK" or "København K, DK" it will be fine please help me for the same issue..

bharat
  • 1,762
  • 1
  • 24
  • 32

1 Answers1

1

Looking around I can't find any mapping platform that can find "1011 København K, DK". It is either a very new address or invalid one.

rbrundritt
  • 16,570
  • 2
  • 21
  • 46
  • There is a serease of address withe same city address starts from 1000, 1002, 1003 ...1499 København K, denmark. And all of them are continues. Bus some zip working like 1000 København K. And 1052 København K. I have using bing map v8 api with web environment. – bharat Jun 24 '16 at 17:01
  • There is a range of postal codes in København K, Denmark between 1000 and 1499, however, not every possible number is a valid postal code. Even of the valid ones, many are PO boxes which don't have locations. Taking a quick look at Bing Maps postal code support for Denmark, over 98% of the postal codes appear to be supported. – rbrundritt Jun 24 '16 at 20:12
  • Hello rbrundritt, Thanks for your reply, You are right 1011 is not a valid zip code. But 1002 København K,denmark is valid address and i am still not able to find it too. Can you please help me into it – bharat Jun 25 '16 at 06:44
  • Also i need guidance on one more thing I am trying to find polygon for denamark areas from here [link](http://www.bing.com/api/maps/sdk/mapcontrol/isdk#sdsLoadBoundaryFromSearch+JS) here i tried to find "Brønshøj, Denmark" which give polygon for full copenhagen whereas google gives the specific area of it. So what should i do to find perfect polygon for it. – bharat Jun 25 '16 at 07:18
  • I also trying to search polygon for "Rungsted Kyst, Denmark" it get me to the location but polygon not display there have any suggestion for it. – bharat Jun 25 '16 at 07:24
  • If 1002 is a valid postal code, it likely is a PO Box, same goes for postal codes between 1001 and 1049. For "Brønshøj, Denmark" set the entityType in your request to "Neighborhood". As for "Rungsted Kyst, Denmark", there is no neighbourhood or PopulatedPlace boundary available for that area. Note that not all boundary types are available everywhere. – rbrundritt Jun 27 '16 at 19:30