I wonder if it is possible to open the bing map application after button click and send there my own .png icon for push pin. For now I can open the bing maps and I have a default pushpin, but I want to change that pushpin for my own.
This is my code for it:
var bingMapsTask = new BingMapsTask
{
SearchTerm = item.CoordinatesString
};
bingMapsTask.Show();
Thanks in advance.
You won't be able to modify the pushpin when using the Bing Maps Task as that opens up a separate app. If you want to be able to customize the map you will need to use the map SDK in WP.
Related
I need convert the image that is in String or Byte to Icon to show in ToolbarItems.
I need show the photo from user in right side from menu of the app.
My code until now:
this.ToolbarItems.Add(new ToolbarItem("name", "icon", () =>
{
}, ToolbarItemOrder.Primary));
If i set an icon from project, him show me like this:
It seems that ToolbarItem in Xamarin.Forms can only use local files (app resources).
See the API documenation - the property is a FileImageSource, which can only take a local file path.
Is there a way to open Bing maps that are inbuilt to Windows phone on click of a button. If you have used the Foresquare app, it loads bing maps and show the destination latitude and longitude when you click the directions button. I want to do the exact same thing. Please help me with any resource you have.
Until now I tried the code in this link
https://msdn.microsoft.com/library/windows/apps/jj710324%28v=vs.105%29.aspx
Problem is when I click the button it says do you want to search an app in the appstore. Please help.
You have to use BingMapsDirectionsTask like this (just replace latitude and longitude with yours):
BingMapsDirectionsTask bingMapsDirectionsTask = new BingMapsDirectionsTask();
GeoCoordinate spaceNeedleLocation = new GeoCoordinate(47.6204,-122.3493);
LabeledMapLocation spaceNeedleLML = new LabeledMapLocation("Space Needle", spaceNeedleLocation);
bingMapsDirectionsTask.End = spaceNeedleLML;
bingMapsDirectionsTask.Show();
You can reed more here about Bind Maps directions task.
I am making a windowsphone silverlight App for windowsphone OS 8. I am Using windowsphone user controls where I make changes dynamically.
My question is just like the way we create an instance of a phoneApplication Page for Normal .xaml Page using NavigationService.Navigate("Source Uri with unique GUID") . How can I achieve the same effect for a windowsphone User Control Page where I make my dynamic changes to update as there is no Navigation Service.Navigate() method available. ?
Currently I have to Navigate like UserControl-Page-UserControl
When you want to Navigate from a page, you can use NavigationService.Navigate().
When you want to Navigate from a UserControl, You can use the PhoneApplicationFrame to navigate.
Code Sample:
(Application.Current.RootVisual as PhoneApplicationFrame).Navigate(new Uri("/MyProjectName;component/MyFolderName/MyPage.xaml", UriKind.Relative));
You need to append a GUID when you want to navigate to a new instance of the same page which you are currently residing.
I have a Windows Phone 8.1 XAML app that uses the MapControl to display maps. In the MapControls Loaded event, I set a valid Bing API key
void MyMap_Loaded(object sender, RoutedEventArgs e)
{
MyMap.MapServiceToken = the key
MapService.ServiceToken = the key
}
I know the Bing API key is valid because the watermark in the MapControl is not shown.
From the page with the MapControl I navigate to another Page where in the ViewModel I try to find a driving route:
var driving = await MapRouteFinder.GetDrivingRouteAsync(new Geopoint(new BasicGeoposition
{
Latitude = Latitude,
Longitude = Longitude
}), Detail.GeneralInfo.GpsCoordinates.Position, MapRouteOptimization.Time);
The problem is that driving.Status is always InvaldiCredentials.
Is there something that I am missing?
The documentation says
Note that you have to provide the authentication token in two separate properties in an app that uses both Map services and the Map control.
and I did this.
The Bing API key I use is generated for Basic / Public Windows Phone App. I also tried to generate one for Basic / Public Windows App, no change.
I have a working app that uses this token. I only set it to a Map control in XAML, and then I can use both the Map and the MapService, apparently.
My Maps key token is 22 characters long. The only way to get it is, AFAIK
Make an app
Upload it to the store but do not submit
You app gets associated with a store ID and you will see a map token
THAT is the token you will need
See screenshot. Is that the procedure you followed?
Also, make sure xmlns:Maps="using:Windows.UI.Xaml.Controls.Maps", not the old Bing control. Don't even know if the old control is still available in the Universal Apps btw
Is it possible to hide the Bing maps coordinates for the user ?
This is my javascript code:
var mapOptions = {
credentials : "My app code here",
zoom:#(Model.Sprint.ZoomFactor),
center:new Microsoft.Maps.Location(latitude, longitude),
showDashboard: false,
disableUserInput: true,
enableSearchLogo: false,
enableClickableLogo: false
};
In my html source, the coordinates become visible to the user but the user is not allowed to see where the exact location is.
Does anyone know how to hide them?
Im using ASP.net MVC 3 so the coordinates come from a viewmodel.
thanks.
As long as you are using the Bing maps javascript control, you cannot really hide this information from the user. The code is running on the user's machine, so how can you hide your source code and data from them? If your requirement is that the coordinates should not be visible in the downloaded source code, you can try something similar to the Bing interactive SDK, where they use an ajax call issued by the client to obtain the map license key at run time. But this is easily defeated by stepping through the code using the javascript debugging feature on your browser.