I was developing a windows phone application in WP7.1, while adding map control we have to set a parameter name "CredentialsProvider". Now i have moved to WP8.0, here while adding map control i am not getting "CredentialsProvider" parameter.
and when i run my application on emulator, it's showing blue square in place of map control, is this because of not setting "CredentialsProvider" ?.
Please Help.
Well, you don't need to use CredentialsProvider property in wp8 app, as CredentialsProvider property is basically the bing api key which a developer issues from Microsoft to enjoy the extended services of bing maps Like making a route, Reverse GeoCoding, GeoCoding. All these services are available as a pert of the sdk in wp8 hence no need to set the attribute, that attribute was only meant till wp7.
Please let me know the problem and requirement in detail if still you havent got the solution.
Related
Hello I am working on UWP map based application. I want to provide a path animation to my pushpin the way demonstrated in the Bing Maps documentation here .
The Issue is
I can't use the bing map SDK as I can not use any other Tile source (like OSM) except for bing and neither can I remove the copyright information.
Anyone can help me with creating path animations a pushpin on the XAML map control? which is provided by default in the Controls
I can't use the bing map SDK
Bing Map SDK is used for previous versions, in UWP app we have MapControl instead. And the animations you mentioned are not provided by SDK, they are just animations in UWP app. So actually you don't need use the Bing Map SDK as what you want has no relationships with the SDK.
Anyone can help me with creating path animations a pushpin on the XAML map control
This article you provided already taught about creating animations with Maps. But the target version in that article is windows 8.1 with Bing SDK not UWP app, so some APIs cannot be used in UWP app. Such as LocationCollection() is replaced by Geopath class, MapShapeLayer() maybe replaced by MapItemsControl class. More details please reference Maps and location overview and the official sample.
I convert some of the animations that now they can be used in a UWP app. You can download the demo here for testing.
I am building an universal app for Windows where i am using maps control for displaying few hundreds of pushpins on map. In WinRT i successfully used Bing maps SDK and it works perfectly as i wish.
Problems coming out in my Windows phone project. There is no Bing maps for windows phone, so i am using build-in maps in wp sdk. Main problem in this restriction from msdn:
The MapIcon is not guaranteed to be shown. It may be hidden when it obscures other elements or labels on the map.
This is unacceptable for my case, i want my pushpins overlay all others items on the map(including others pushpins), so user could see them all at the start of applications. I already tried to use ZIndex and all advices from the google, but nothing helped for me.
Did anyone solve this problem or can give me some advice to workaround this restriction?
The alternative is using XAML children of the Map, e.g.
<maps:MapControl>
<TextBox x:Name="MapOverlay" Text="Test" maps:MapControl.Location="{Binding FooLocationBinding}"/>
</maps:MapControl>
(MapControl.Location is an attached property which can also be set from the code behind if you won't be taking advantage of bindings.)
I'm working with MapControl from wp8.1 default controls. I can add different elements on map:
MapControl.MapElements.Add(polygonElement);
MapControl.MapElements.Add(mapIcon);
The question is, how to share this element to somebody? When I use Bing Maps browser app I can simply click on "share" button and get a link
http://binged.it/1zEKwlo
that will display all added data to anyone who has this link. Is there any way to share MapElements to another user?
Not really. If you want to share a map view you could capture a screenshot and send that, but that wouldn't be very interactive and I'm guessing not what you want. If you only want to share point based data then you can create a link to the Bing Maps consumer site which would cause the native maps app on Windows Phone to open (opens in browser for other apps). This would allow you to share a single point. If you want to share anything more than that I would recommend creating a mobile website that either loads data from the URL string, or from a database. If you are only sharing a little bit of data a URL might be enough. If you have enough data to make a URL longer than 2083 characters then you will need to look at a different solution. One option is to create a web service for saving the map view. This could generate a unique ID for the view and then you could pass that ID to a custom mobile website as a parameter in the URL. This process requires a decent amount of development but would remove most limitations you will encounter using other approaches. If you use this method I recommend taking a look at the Azure mobile services as you can quickly and easily create a web service that is connected to a database. You can even add authentication easily as well if you wanted.
We are investigating the potential use of Bing Maps WPF control in OFFLINE mode (which will be called MercatorMode in the control). OFFLINE mode implies that we download on a desktop machine the tiles for different zoom levels and then the WPF control accesses these pre-saved tiles instead of connecting to the Internet. Technically this scheme works perfectly.
What is unclear right now is how to obtain (download) the tiles without violating any Bing Maps license rules. So it raises two questions:
Whether there exists a way to officially download Bing Maps tiles
Whether it is officially allowed to use the control in the OFFLINE
mode (assuming that we’ve got some tiles from some source of tiles)
The legal documentation for Bing Maps is rather confusing than clarifying. So we’d like to ask about the particular experience of other developers.
Our ultimate goal is to have:
a good WPF control for maps (which is a natural WPF control, not just a
wrapper over a WinForms control) supporting OFFLINE mode
a legal source of tiles to be used in the OFFLINE mode (costs are
not an issue – we are ready to pay for tiles)
Maybe the community would suggest another pair WPF Control + data source for tiles. We do not need any deep level of zooming since we plan to use the control and tiles only for drawing the borders of countries (excluding extremely small countries).
Right now we see that Bing Maps as a data source also supports Bing Maps WPF control, but the licensing terms are a real mess.
PS
We are developing an “in-house” desktop application which will be used internally in our organization while the Bing Maps license never explicitly references desktop applications while mentioning web-applications and Windows Store. Does anybody know whether Microsoft intentionally doesn’t mention the desktop applications?
None of the Bing Maps controls can be used offline. This is against the terms of use. MercatorMode is not an offline mode, this is just a mode which all the standard map views inherit from and which you can use to have a blank background to a custom tile layer. The Map control will always need to have access to the internet otherwise it will not be able to authenticate the map. When it can't authenticate the map an error is thrown. You can handle this error such that it disables the map instead of crashing the app by using the following code sample: http://rbrundritt.wordpress.com/2012/04/05/bing-maps-wpf-internet-connection-issue/
For an offline map control solution take a look at GMap.NET: http://greatmaps.codeplex.com/
Telerik has a nice Map control which supports:
Rich geographical context for large volumes of data
Heat maps
Multiple tile layers
Multiple Map Providers
Support for Bing Maps, OpenStreetMaps, custom map providers, as well
as visualization of geospatial data.
You can try https://greatmaps.codeplex.com/ which works fine in WPF/Offline mode. First you may have to use their application to download the desired maps at all zoom levels. The maplets are stored in SQLLite database which you may consume in your WPF application. The entire source code along with the map control in WPF is also available there.
I am new to Windows Phone App development. I am developing app for windows phone 8.
I want to add map function in my app.
But I searched the stack overflow, I can see that I have to use REST service. So please can anyone help me how to use REST service and get the location based data using Bing Map.
You need to use the Bing Maps API detailed here
Ultimately though you are going to want to look at how to find a location by query on MSDN. These apis are easy to use but from experience I would use google maps API.
This is an example call
http://dev.virtualearth.net/REST/v1/Locations/locationQuery?includeNeighborhood=includeNeighborhood&maxResults=maxResults&include=queryParse&key=BingMapsKey
You would need to replace the variables with your data. For example the bingkey needs to be given to you by microsoft here