How to open Maps application from a Metro style app? [closed] - windows-8

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
When a user clicks an address in my Metro style application, I would like to open the Maps application that comes with Windows 8 to show the address on the map.
I know you can't start processes directly due to sandboxing, but it is possible to start eg. a browser by using the Launcher class. Is there any similar way to start the Maps application with a specified address?
It would of course be possible to integrate the map into my application using the Bing Maps for Metro Style Apps, but I would rather not go there if an easier way exists.

Here's the documentation for "URI Scheme for maps application". Samples:
bingmaps: /* Opens the Maps app centered over the user’s region */
bingmaps:?cp=40.726966~-74.006076 /* Opens the Map app centered over New York City */
bingmaps:?cp=40.726966~-74.006076&lvl=10 /* Opens the Maps app centered over NYC at zoom level 10 */
bingmaps:?bb=39.719_-74.52~41.71_-73.5 /* Opens the map over NYC using the bounding box of the screen */

The Windows 8 Maps App supports protocol activation, so the scenario you mentioned is supported. The URI definition hasn't been published yet. I'll post a link when it's available on dev.windows.com.

Please find more details on my article: http://dreamteam-mobile.com/blog/2012/06/launch-maps-application-in-windows-8-csharp/
Summary, install Nuget Windows8.MapsHelper
Install-Package Windows8.MapsHelper
and then use following code:
MapsHelper.OpenMaps(lat: latitude, lon: longitude);

Related

OS Data Hub not working on iPad or iPhone

I look after a website which displays UK Ordnance Survey maps for people going on walks in SW England, and it relies on displaying a marker on an OS map, in response either to an alphanumeric OSGB grid reference, appended as a query string to the name of the HTML file which displays the map, or to a click on the OS map produced by the HTML file, in the absence of a query string. This has all worked well for several years, on both Windows PCs and mobile devices, using OS OpenSpace, which is based on OpenLayers 2, but now Ordnance Survey have decided to enforce a new system based on Open Layers 6, and requiring a complete re-code of the JavaScript. OS provide example code for various scenarios, from which I have re-written my code to run perfectly on a Windows PC with a mouse, but it fails on an iPad or an iPhone, particularly if the iPad is several years old.
Using a current Apple device, I cannot display a scaled vector graphic on an OS map, either at hard-coded co-ordinates, or in response to a tap on a map. A tap will however bring up a pop-up at the tapped point, and a swipe on the map will pan it. Using an iPad several years old, in addition to the above problems, opening two fingers will not zoom the map, and a swipe will not pan it. The only things that work are the + and - buttons on the map.
I have read that I may need to include a Controls section within my Map command, along the lines of:
controls: [
new OpenLayers.Control.TouchNavigation({
dragPanOptions: {
enableKinetic: true
}
}),
new OpenLayers.Control.Zoom()
],
but if I include this code, my JavaScript crashes, and the JavaScript Error Console within MS Edge gives error message 'OpenLayers is not defined'
Ordnance Survey tell me that my problem 'is an issue relating to the mapping library, OpenLayers, rather than our APIs' so my question is, how do I get code based on the OS examples to run on mobile devices of any age, in the same way my existing code based on Open Layers 2 has run for several years?
I will gladly supply a copy of my code which works on a Windows PC, but not on an Apple device, on request.
OpenLayers needs polyfills on older devices/browsers. Try adding
<script src="https://unpkg.com/elm-pep"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList,URL"></script>
before the ol.js script. The default controls should be sufficient (the code you have used is Openlayers 2 format and will not work with OpenLayers 6).

How do I listen to physical buttons with react native? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I am trying to detect when the user presses volume up button within a react-native application. I am not using any media as music or video directly in the phone, I want to use the volume buttons for a different purpose. e.g: triggering the camera shot.
#dv3's answer is helpful for iOS, but IFours' package will not work on Android (see https://github.com/ifours/react-native-volume-slider/issues/1).
My solution for Android has been to use https://www.npmjs.com/package/react-native-volume. This will detect media volume changes. (I'm pretty new to React Native so I'm still working on a way to force the volume button to change the media volume specifically).
Edit: playing a silent sound on loop to force the "media" volume input. Pretty hacky but it works.
This looks promising: https://github.com/c19354837/react-native-system-setting
Also for getting Brightness, Wifi switch, Location, Bluetooth status
Works on iOS & Android
I would suggest that you make your own component. If you want an existing module: implement it with https://github.com/IFours/react-native-volume-slider by making it invisible and listen to onValueChange.

Bing Maps in Windows 8 app

My question is similar to this one "https://bitly.com/UaQOC4", but that question is somewhat misleading.
In my Windows 8 Store app, I have a Bing map reference to a particular location somewhere in South Africa. The referenced location will have multiple pins to denote key areas of interest to users of the application, with an info window for each of the pins.
When a user clicks on a pin, the info window will give them more information, like statistics around the location and a link to a page within the application, for example: /pages/nests/crowsnest.html.
What I need is to be able to push the user, when clicked on the location in the info window, to this page, however, this does not seem to be allowed.
From my understanding, we're trying to force a page load from within the current domain space (our application) from outside of the application scope (info window == iframe) as this is not a web page, this seems to be disallowed.
Is my assumption correct in that we're trying to break the domain policy here? I don't see how we can, as we're just redirecting users to a page.
I have tried the WinJS.Navigation.navigate("/pages/nests/crowsnets.html") and event a normal -tag but neither of these approaches allowed me any success.
I'm still not sure what are you trying to achieve. You can use Bing Maps control in your Windows 8 app and you can pin any Pushpins in there, You can also handle the behavior when user taps any pin and show more detailed info on the map.
Bing Maps SDK for Windows Store apps

Add to home function [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How could I create a shortcut on desktop in iOS through an app
I want to know if it's possible with the iOS API to put a web page on the home screen (in Objective-C). A specific event to catch ? A "magic" function ? :)
Thanks :)
Nope, apps can not do anything outside their sandbox.
As the answer to this question explains, you can launch your page you want to save in Safari and provide users with instructions to save the page from there, then use a url to switch apps back to your app from Safari afterwards, but you can't add a webapp to the springboard from your app itself

How to implement TopBar in a Cocoa Application?

I am new in Cocoa development. I want to implement this type of Bar (below image) in my application. How can i implement this? Which control using for this ?
Start with some sample code related to NSToolbar.
Read Mac OS X Human Interface Guidelines. The section relevant to your question is Designing a Toolbar, but it would be a good idea to read the entire document. It contains a lot of important information about the various user interface components, how to use them, and links to additional documentation on each component.