KML to control Optional Features (such as "Tour Guide") - c#

I'm new to KML programming but have gotten most of what I need to do working, which is multiple map overlays.
One thing I want to control but haven't found a way to do so are the options you can turn on/off via "View" on the GoogleEarth.exe menu.
For instance, if I run Google Earth stand alone, turn on "Tour Guide" (View > Tour Guide), then terminate Google Earth, when I start up my application that interacts with Google Earth, the Tour Guide photo strip is on. If I exit my app, re-run Google Earth, turn off the Tour Guide, and exit, then the next time I start my app and it starts Google Earth the Tour Guide is off.
Are there KML commands to control this ("Tour Guide") and other optional features? I'd like to do this inside my app rather than forcing the user to manually configure the settings the way my application wants them.
By the way, I'm coding in C# in .NET Framework 4, using GoogleEarth version 7.0.2.8415, and running on Windows/XP and above.
Thanks for any help/guidance you can supply!
john

Google Earth provides additional elements in it's extended KML namespace to achieve things like the tours (using the gx: prefix for those XML elements as you describe / have used above). In all cases these extended elements tell Google Earth how to interact with the various geographical elements within the KML, and none define the behaviour of the Google Earth application and plugin in anyway.
So, short answer is out of the box Google Earth and KML cannot achieve your desired behaviour.
EDIT Here is the relevant link to controlling the tour if you are using the Google Earth Plugin in you app: https://developers.google.com/earth/documentation/reference/interface_g_e_tour_player

Related

Xamarin Forms Image Recognition

I would like to know if there is any recognition system for Xamarin Forms that can recognise a point (for example a green filled circle) with the camera, in order to extract info from that point (like coordinates).
I know that EmguCV maybe can do that, but the samples are not working and if you want to use it on Xamarin Forms, you have to pay a commercial license, what does not make sense to me if I can't test it before.
Any info about this would be greatly appreciated.
I see 3 ways for you:
use EmguCV:
I use EmguCV for Xamarin Forms, and it's working pretty well.
But it's pretty complicated to configure it... Try this tutorial: Using Emgu with Xamarin Forms. I think you can test it without buying a licence but only on a simulator...
I also found an Azure service called "Custom Vision". You can train a neural network? to recognize objects on your pictures... Take a look at here (there is a free plan): Custom vision Azure service
Finally, If you have enough skill in image processing you can do it by yourself (there are many tutorial on the web).
==> For me the first solution is the best (Emgu is really powerfull). So if you plan to use it for several projects, I suggest you to buy a licence...
"Custom Vision" Azure service look really convenient but I don't know if it fit your needs... You have to test it, and the free plan is limited too...
Good luck

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.

Surface offline maps

I'm developing Surface application, but I came across a problem. I need to develop a control with next abilities:
World map on background (should display only continents).
I need a way to find out on which continent user touched(interactive background map).
Any controls can be added on the top of the map control (for an example video-player control for different regions of the map).
Map control should works in offline mode only (without any
connection to internet).
I can't find any frameworks that would meet my goals.
So, anyone know something projects/code samples that can help me to achieve my goals
Offline mapping could be done in many ways, one of them would be download / get shapefile for continents. (You can search for that). Later you can use SharpMap to display that shapefile in WPF application. SharpMap is a .Net framework based open source application which enables reading multiple geospatial formats.
Another option to read geo-spatial data is DotSpatial.

How are live tiles made in Windows 8?

I've searched the samples, the developer site, the getting started and the enhancing bla bla bla pages.
Even using some search queries on Google, I can't seem any information on live tiles in Windows 8.
How do I create a live tile in Windows 8? What languages can be used for that? C#? XAML?
Finally figured it out, these live tiles are using tile notifications as noted by others.
Here is the minimal code necessary for updating an existing default tile with a template:
You have to load in a template and adjust it, or produce your own XML code. See the tile schema...
var tileXml = Notifications.TileUpdateManager.getTemplateContent(template);
You need to create a notification, which apparently is an update to a tile.
var notification = new Notifications.TileNotification(tileXml);
You need to create an updater, which will provide you with methods to notify through your tile.
var upd = Notifications.TileUpdateManager.createTileUpdaterForApplication();
If you have all this, you can send an update to the client.
upd.update(notification);
http://msdn.microsoft.com/en-us/library/windows/apps/br211386
You can use either C# or VB + XAML or HTML/JS or C++.
That was the big announcement at the BUILD conference and the whole point of WinRT (God I hope they actually are serious about pushing WinRT for more than a year).
Otherwise it would be back to the Silverlight/.Net uprising that we saw after the first preview. . .
edit
You'll first need to learn the terminology of the MetroUI. You can also find more info under Windows Phone 7.
The Live Tiles can send tile notifications. That's how the socialite tile does the facebook feed. The OS will cycle through tile notifications that you've declared. This is all in the basic Tile sample and the advanced Tile sample.
Here is a link to all the samples from the BUILD event.
Start here for a step by step walkthrough of the platform. I would start there if the reference documentation is confusing.
The documents for notifications have been updated since the Consumer Preview release - a good starting point is the 'choosing a notification delivery method' document.
It has all of the relevant pointers to push, polling, scheduled and local notifications.
The available Metro documentation is here:
http://msdn.microsoft.com/en-us/library/windows/apps/
It's pretty patchy at the moment but there are samples, such as:
http://code.msdn.microsoft.com/windowsapps/Advanced-Tiles-Sample-1995ac42
Not all the samples are available in multiple languages, and that tile example is JS only, but based on what I've read elsewhere, it seems everything can be done with .NET languages, native (C++) or JS using the same APIs.
App tiles and badges sample is what you are looking for.
NotificationExtension library (part of MSDN sample in toast notification, application tile notification ) is very easy to use.
For tile/toast notification updates following approaches can be used
Directly from the application
From the background tasks
From the WNS (push notification service)
Thorough samples are available in msdn code samples

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