Why can't I see buildings on my bing map? - c#

I can't understand why my bing map doesn't show buildings.
The ShowBuildings is True.
You can compare 2 screenshots and the difference is huge.First - Bing Maps for Windows Store appp (My app)
Second - Native Bing Maps inside Windows 8 Pro
My xaml is pretty simple.
<MapsCore:Map x:Name="PART_Map"
Credentials="STRING_KEY"
ShowBuildings="True"
ShowBreadcrumb="True"
ShowNavigationBar="True"
/>
What is wrong?

According to this website, some features of the Bing Maps API (like BirdsEye Imagery) are not available for public testing yet, and are only available through the Extended Modes SDK. This may be where your problem is coming from.

Related

How to display a map with a traffic layer on Windows Phone 7?

I'm currently developing a Windows Phone 7 app in which I would like to display a map with a layer of the road traffic.
First, I tried to display a Bing AJAX Map and a Google Map through the webBrowser control. If the map is displayed, the UX is just awful. In fact, the webBrowser control doesn't allow the user to navigate or zoom with his fingers. It captures all the manipulations and doesn't apply them on its content.
Then, I tried to use the Bing Maps control and override the Tile layer with another API like the Nokia one or the OpenStreetMap one (like explained on the Nokia wiki here and here). It works, but none of these API allows to display a traffic layer (or I can't find the way to do it).
Finally, I used the trick to use the Google Maps tiles with a traffic info layer. If it works, I'm pretty sure that this solution is not legal. Some apps on the Windows Phone Store display the Google Maps with a traffic layer, but if they don't use the Bing Map control and override the Tile layer, I don't know how they do...
Does someone know how to display a map with a traffic layer into a Windows Phone 7 app in a legal way ? Did I miss something ? Maybe there is a solution I don't know or I don't think about ?
I really hope that someone will be able to help me !

Custom zoomable images using Bing maps

I want to use the Bing map WPF control and I'm wondering if it is possible to set our own "image source".
Basically I'd like to use the control to provide deep zoom functionality for various images that would be loaded by my application.
I know that it's possible with Google maps (as shown here: http://blog.mikecouturier.com/2011/07/create-zoomable-images-using-google.html#maps_code_tilesgen)
but I was wondering we can do something similar with Bing maps?
P.S.: I would prefer using Bing because Microsoft provides a native WPF control, something that Google doesn't.
In order to add a custom map (or image) tile provider you would have to implement a TileSource and override its GetUri method to provide the URI of an image tile.
See Adding Tile Overlays to the Map for the details. The code sample there is not that great, since some things they do in code could better be done in XAML, but it is a starting point.
Note however that even if you don't use Bing Maps content, using the WPF control forces you to use a Bing Maps API Key. The control authenticates your key at the Bing Maps service provider, which will require an internet connection. Hence your image display application won't run in an offline environment, or to be more precise, it will run but display an ugly error message in the center of the control area.
You certainly can and it's incredibly easy to do in Bing Maps. Microsoft has developed a tool called MapCruncher that cuts a supplied image into tiles with the structure expected by Bing Maps. This is really important because, although Bing Maps and Google share the same tile structure, Bing Maps uses something called a quadkey to define each tile (meaning, the z-x-y of the tile).
Note: it's also possible to load tiles made for Google Maps in Bing Maps. You just need to tweak the tile source.
Anyway, better shown than said.
Here's a really detailed tutorial by the Microsoft Research team on using MapCruncher:
http://research.microsoft.com/en-us/um/redmond/projects/mapcruncher/tutorial/version3.0docs/index.htm

Unable to add reference to Bing Maps?

I was trying to create an app using Bing Map. in which i need to add two reference libraries
Microsoft.Maps.MapControl.Common.dll
Microsoft.Maps.MapControl.dll
I followed the tutorial from : http://www.codeguru.com/csharp/csharp/cs_misc/article.php/c18305__1/Working-with-Bing-Maps-in-Silverlight-and-Windows-Phone-7-Applications.htm
But when i installed BingMapAppSDK from Bing Maps it didn't have these api.
It does have libraries
Microsoft.Maps.Core;
Microsoft.Maps.MapControl;
Microsoft.Maps.MapControl.Types;
Microsoft.Maps.Plugins;
But not the above ones.. Due to this i am not able to use Bing Maps.
I am using Visual Studio 2010 and creating Silverlight app and Silverlight 5 is installed.
Please suggest.
You have To add a Service Reference.
1 . Right click on "reference" and then Add Service Reference.
then copy one of the four links from here which you want to use.
http://msdn.microsoft.com/en-us/library/cc966738.aspx
Click on go .
Name it according to you .
Now try to add namespaces
like
using ProjectName.GeocodeService;
using ProjectName.ImageryService;
Hope This helps.
There are different Bing Maps SDKs for different platforms although, confusingly, they do share rather similar namespaces. It's really unclear from your post which platform you're trying to target...
To develop a Silverlight Bing Maps application, you need the Bing Maps Silverlight control SDK, available from http://www.microsoft.com/download/en/details.aspx?id=2949
To develop a Windows Phone 7 Bing Maps application, you need the Windows Phone 7 SDK, http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=27570
To develop a "Bing Maps App" (note the quotation marks), which is a special kind of Bing Maps application that is hosted by Microsoft on the bing.com/maps site, you need the Bing Maps App SDK: http://connect.microsoft.com/bingmapapps
Note that there are also dedicated Bing Maps SDKs for iOS, Android, and WPF development, as well as the traditional AJAX control.
The name of the dll's can be different from the namespaces they provide. If I understand your question correctly, you already have access to everything you need. The four libraries are what you need to make your apps, while the dll files are what you are already using to get access to those namespaces.
In the example link you listed, he shows how make a reference to the map control namespace by doing the following:
xmlns:m="clr-namespace:Microsoft.Maps.MapControl; assembly=Microsoft.Maps.MapControl"
In this case, the assembly (dll file) and the namespace are the same, but they don't have to be and thats why they are specified separately.
From here, just add the map control.
<m:Map CredentialsProvider="Your_Credentials" />

Getting Google Earth to work with Silverlight?

Is it possible to have Google Earth integrated into a Silverlight app? I've tried searching on Google but the best results I could find were forum posts from 2008 which were uncertain at best.
I don't believe there is any straightforward way to utilize Google Earth from a Silverlight application. And even if you could get it to work, you would have practically no control over the Google Earth portion of the program since, to my knowledge, it is not designed to be hosted in other applications.
However, if what you want is a 2D/3D GIS (Geographic Information System) inside your Silverlight application, an alternative to Google Earth is the Bing Maps Silverlight Control. This is already Silverlight compatible, has a full 2D/3D API and provides some of the same features as Google Earth.
Here are two links about the Bing Maps Silverlight Control:
Bing Maps Silverlight Control 1.0 Released
Changes to Bird’s eye and 3D Maps
As I recall, you have to apply for a free license to use this and there are some restrictions. Please read the license carefully.
Please refer to the following links:
Using Google Maps with ArcGIS Silverlight
Display Google Maps Imagery using Bing Maps Silverlight Control
However, there do exists some legal issues as Google has prohibit the use of Google Map outside of their supplied API. As pointed in the first link:
Now for the legal answer. In short, no. You cannot access Google Maps imagery outside of an interface (read: APIs) provided by Google.

Is there a way to open the Bing Maps App on Windows Phone 7 to a specific location?

The built-in emulator from the WP7 Tools doesn't have the Bing App installed, and I don't have any phone hardware to test with. So I'm simply wondering, how can I open the Bing Maps Application to a specific Lat/Long?
Related Questions:
iPhone -- How can I launch the Google Maps iPhone application from within my own native application?
Android -- https://developer.android.com/guide/appendix/g-app-intents.html
It seems that starting from the OS version 7.1 there's a specific task available for this, see BingMapsTask and for directions the BingMapsDirectionsTask.
Unfortunately there is no way to launch the Bing Maps App from within your own application.
In an early CTP there was a way but this has been removed. Hopefully it will return in the future but it is not on any current, public, roadmaps.
This leaves two alternatives.
Option 1
You could perform a search for the lat/long you want to show. The search app does directly integrate with the bing maps app so, assuming that bing can take the lat/long you provide and return something useful, the user would still be able to do whatever they wished within the bing maps app.
This has 2 downsides though. Firstly, you have no control over the search results. And, secondly, you cannot test this on the emulator.
Option 2
You could use the BingMaps control within your own silverlight application.
(Prior to the RTM, it was posible to use the full Silverlight version of the control within your app. But, this had a few quirks and was only ever intended as a stop gap solution.)
While not as fully featured as the app, the control does offer a lot of functionality.
Without a real device, but you could simulate location data, for testing, with the Reactive Extensions.
Even with a real device you will probably want to look at doing this as it's a lot easier than trying to debug while walking or driving around.
Edit:
As per this post by Kevin Marshall, if you're going to use the WebBrowserTask() (option 1 above) prefix your query with "maps:" and URL encode your query string. eg:
var task = new WebBrowserTask();
task.URL = "maps:1%20N%20Franklin%2060606";
or
task.URL = "maps:37.788153%2C-122.440162";
Bing maps silverlight control is now supported out of the box and is part of the tools... learn more about it here: http://channel9.msdn.com/Learn/Courses/WP7TrainingKit/WP7Silverlight/UsingBingMapsLab/Exercise-1-Introduction-to-the-Bing-Map-Control
Yes you can do this. I've got it running in the emulator (however, as many people have said there's no guarantee the Bing Maps for Silverlight control will run on the actual device)
Here is the xaml:
<m:Map Grid.Row="0" x:Name="mapMain" ZoomLevel="5" Mode="AerialWithLabels" CredentialsProvider="YOURBINGMAPSLICENSE" />
and here's some code to set the location in the .cs class
var ppLoc = new Location(-37.821285, 144.97785);
mapMain.SetView(ppLoc, 17);

Categories

Resources