How to share map with pushpins : Bing Maps, WP8.1, Map Control - c#

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.

Related

How to group apps in Metro in a similar way to a web app?

As a web developer, when I have multiple sites that are related by a common theme or common department, I have a home page that has links to the different sites. For example, there may be a site for reports (output to pdf or excel), another for inputting and editing sales data, and yet another for real-time tracking. Normally these links are in a header or sidebar which is static and can be accessed by all associated apps.
I'm reading about Metro/Modern apps now. I'll be trying to make my first Metro app soon. However, I'm wondering if it's possible to have (at least the illusion) of accessing 3 different apps through 1 app. So the user, just as in the web app, goes to one place.
If so, does anyone have any resources they can share?
To include multiple apps in the same frame they would need to all be part of the same app.
If you want links to jump between apps then you can create a protocol association to launch into the apps. This can include an arbitrary string so you can deep link rather than going just to the opening page.
On Windows 8.1 this connection is one-way: launching the protocol is fire-and-forget. The launching app doesn't get any feedback or results from the launched app.
Windows 10 adds the ability to return results to use the app as a service. I think this sounds more like what you are looking for.
See Auto-launching with file and URI associations on MSDN and the Build session App-to-App Communication: Building a Web of Apps
actually in Windows Universal app it's the same Approach. You got your app, and different pages where you could navigate back and forth... each page with it's unique look depending on your Need.
The user will open one app to Access all...
searching a bit in the net will Show you a lot of examples... Topic: Navigation, LiveCylcles, ...

Interactive Google maps on a C# winform

I have an application with Google maps in it. Currently the maps are rendered in a WebBrowser via the Maps Javascript API.
I have a requirement to make the map interact with the application. Specifically, I have placed markers on the map. The winform needs to register when one of them is clicked, double clicked, etc. and know which one it was. If the user right-clicks on a blank area on the map, I need some way of registering both where to draw the context menu and the lat/long that pixel represents geospatially.
I don't care whether the map remains in a webbrowser control or is replaced with something else. If needed, I can tear the whole thing out and put a new map in there - but it should be Google (because we have the expensive enterprise API) and it absolutely has to remain inside the winform.
How can I accomplish this interactivity?
Almost missed the part where you said you're willing to replace the web version with something else.
Have a look at Great Maps - for Windows Forms and WPF. It is a custom WinForms control you can drop on a form.
It supports a lot of map providers, Google Maps included. They have a demo with which you can play and see how it works and how it can be integrated.
From experience, I can say that it is possible (quite easily) to bind to map events (marker clicked, double clicked as well).
Something worth noting is that using Google Maps with it might violate Google's terms of use (you also get a warning in the demo app). You can always explore some of the free providers, like OpenStreetMap.
I would not use Great Maps for windows forms and wpf (GMap.Net) because it violates Google Map Usage Terms by accessing Google Map Tiles directly.
You can host one by yourself if you follow this link:
https://github.com/mchall/GoogleMapsApi.
Or you can use one free WPF control at:
https://archive.codeplex.com/?p=wpfgooglemap.
We use GDS Google Map. It is not free, but affordable. It does what we need.

Bing Maps WPF control in OFFLINE mode (MercatorMode)

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.

Add and retrieving data from here maps

I working with windows phone app and I wonder, is there any way I can retrieve data from here maps like bus station or airport and showing that data into my apps?
and also to add some place information into here maps? like adding location in foursquare?
Not certain which maps offering this question is about, since There are no HERE maps API offering for the Windows Phone 7 as such, the maps API there were using Bing Maps instead.
Anyways, if this is HERE Maps question, then the SDK API does not offer any Functionality for what you are asking, however there is Places API with HERE, which could give you the places and you could search those places by category.
For adding places, I suppose that currently the API does not offer any interface which could be used by normal 3rd party developer.

Google Maps in C# Visual Studio application

For my university I have to create an application that for the User Interfaces paper that I'm doing. I want to create an application that focuses on Africa and allows the user to plot on the map some points of interest.
First thing first though, i need to be able to get the Google maps API working in a form. Does anyone have any idea how I would do this?
Google maps is based on JavaScript. You will need to embed the maps objects into the page and use it that way.
A good starting point would be http://code.google.com/apis/maps/index.html and the most basic of tutorials is available at http://code.google.com/apis/maps/documentation/javascript/tutorial.html#HelloWorld.
I would definatley recommend then links above and then move onto something like http://googlemap.codeplex.com/. It's better to know what's going on underneath before abstracting it away.
Alternatively, you may wish to check out GMap.net (the website is not GMap.net: http://greatmaps.codeplex.com/)
GMap.NET is great and Powerful, Free, cross platform, open source .NET
control. Enable use routing, geocoding and maps from Coogle, Yahoo!,
Bing, OpenStreetMap, ArcGIS, Pergo, SigPac, Yandex, Mapy.cz, Maps.lt,
iKarte.lv, NearMap, OviMap, CloudMade in Windows Forms & Presentation,
supports caching and runs on windows mobile!
I've used this before with WinForms and found it pretty handy. I suggest this because parts of Africa may be better served by different map vendors.

Categories