Bing Card on iPad / iPhone

How can I integrate a bing card into a business iPad or iPhone application?

Can anybody help me?

+3
source share
2 answers

I am writing a javascript wrapperfrom BING Api to ObjectiveC.
This is not the best solution, but it works.

Objective-C use a method to directly call javascript from your code .

You can use stringByEvaluatingJavaScriptFromStringfrom yours UIWebViewto call all js functions (increase, setmapType, etc ...).

Your UIWebView should be an html page that contains a basemap.

Like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
   <head>
      <title></title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2"></script>
      <script type="text/javascript">
         var map = null;

         function GetMap()
         {
            map = new VEMap('myMap');
            map.LoadMap(new VELatLong(45.46347, 9.19404), 10 ,'h' ,false);
            map.HideDashboard();
            map.SetMapStyle(VEMapStyle.Road);
            map.SetZoomLevel(10);
         }   
      </script>
   </head>
   <body onload="GetMap();">
      <div id='myMap' style="position:absolute; left:0px; top:0px; width:320px; height:460px;"></div>
   </body>
</html>

Bing Link ( http://www.microsoft.com/maps/isdk/ajax/ )

:

http://www.albertopasca.it/whiletrue/2010/10/iphone-microsoft-bing-map-iphone-ipad/

js ( map JS html!):

- (void) setZoom:(int)level {
    [self stringByEvaluatingJavaScriptFromString:@"map.setZoom(%d);", level]];
}
- (void) setCenterPoint:(NSString*)point {
    [self stringByEvaluatingJavaScriptFromString:[@"map.setCenterPoint(%@);", point]];
}
- (void) zoomIn {
    [self stringByEvaluatingJavaScriptFromString:@"map.zoomIn();"];
}
- (void) zoomOut {
    [self stringByEvaluatingJavaScriptFromString:@"map.zoomOut();"];
}

... !

, !

.

+3

Bing Maps iOS SDK, iOS:

Bing Maps IOS SDK

+2

All Articles