How do I plot an address using UWP MapControl - win-universal-app

For the Universal Windows Platform (UWP) MapControl, I want to plot a street address. Unfortunately, as far as I know, the control only accepts Geopoint locations for Center.
Ex:
myMap.Center =
new Geopoint(new BasicGeoposition()
{
//Geopoint for Seattle
Latitude = 47.604,
Longitude = -122.329
});
How do I convert a street address to a Geopoint location and back again? Is there another way to plot street addresses?
Thanks for your help.

To convert a street address to a Geopoint location and back again, you can use the MapLocationFinder.FindLocationsAsync and MapLocationFinder.FindLocationsAtAsync method.
Convert addresses to geographic locations (geocoding) and convert geographic locations to addresses (reverse geocoding) by calling the methods of the MapLocationFinder class in the Windows.Services.Maps namespace.
For more info, see Perform geocoding and reverse geocoding.

Related

Find the right module and memory address in a game

I'm trying to create an overlay with nodeJs and ElectronJS for a game that shows real-time stats while playing, but I'm currently stuck on how to find memory adresses I need and which module of the game process I should aim at.
Here is an example of a nodeJs script that finds the player team number in CS:GO using node package memoryJs :
const memoryjs = require('memoryjs');
const processName = "chrome.exe";
const process = memoryjs.openProcess(processName);
const offsets = {
localplayer: 0x12974236,
m_iTeamNum: 0x240
};
const clientModule = memoryjs.findModule("client_panorama.dll", process.th32ProcessID);
const localplayer = memoryjs.readMemory(process.handle, clientModule.modBaseAddr + offsets.localplayer, "int");
const teamNum = memoryjs.readMemory(process.handle, localplayer + offsets.m_iTeamNum, "int");
console.log(`Localplayer team number: ${teamNum}`);
Let's assume I want to do the same on an RPG game that triggers an event with the item name everytime one is looted.
How can I find the right module name that handles this game behavior ("client_panorama.dll" in this example) and which adress offset stores the array of items(0x12974236 and 0x240 in this example)?
Many examples on the net show how to find adresses with CheatEngine on existing values like the health bar in an FPS game, you can easily iterate through memory values by searching your current life value, take damage, find the new value and so on until you have only 1 left adress.
I probably can do the same with a test case where I loot multiple items then scan for their names but I suppose that the gear name is not stored in the same adress everytime a new gear is looted, the game might store it in some sort of arrayList of Item objects that can have various size and various indexes.
I'm totally new to memory adresses, I think I'm not thinking the right way, am I missing something ? Any advanced explanation would be much appreciated.

How do I get the list of strings in tzdb used as time zone initializer?

SO I am new to NodaTime and trying to use it to for storing timezone information using DateTimeZone object.
I came across below sample in user guide etc. which give me a nice DateTimeZone object from tzdb, which is great.
var london = DateTimeZoneProviders.Tzdb["Europe/London"];
My question is - how do I get a list of timezone strings ("Europe/London") which are used in the tzdb. I looked around, nowhere to find. Is there a standard list somewhere which I can refer to? How does this work? ex. - what is the string I should pass for EST?
Thanks!
To fetch the time zone IDs programmatically, use the Ids property in IDateTimeZoneProvider. For example, to find all zones:
var provider = DateTimeZoneProviders.Tzdb;
foreach (var id in provider.Ids)
{
var zone = provider[id];
// Use the zone
}
For Eastern Time, you probably want America/New_York.
More generally, these identifiers are the ones from IANA - and they're the ones used in most non-Windows systems.

Google maps directions from A to B considering traffic

Is there any way to get google maps directions from A to B with considering traffic at the moment of calling the function?
This code below works fine if it is empty road:
var gm = require("googlemaps");
gm.directions("from", "where go to" , function ( err, data ) {
console.log(data.routes[0].legs[0].distance);
console.log(data.routes[0].legs[0].duration);
}, "false");
I am new to google maps, so please any thought to spare?
A quick look at the documentation gives you a clear answer:
durationInTraffic (optional) specifies whether the DirectionsLeg result should include a duration that takes into account current traffic conditions. This feature is only available for Maps for Business customers. The time in current traffic will only be returned if traffic information is available in the requested area.

Using an address with Venue Search

I am trying to use a full address with venue search and not having much luck.
Passing the string 'brooklyn NY 11201' via the near param returns a list of venues in the 11201 area code.
Passing the string '22 Jay St, Brooklyn NY 11201' via the near param returns a failed geocode error.
The near, client_id, and client_secret params are the only params I am passing. Is there something else that I need to get the foursquare geocoder to work, or does it just not accept specific addresses?
Unfortunately, the Foursquare geocoder doesn't support the conversion of fine street addresses very well. City- or zip code-level granularity will be your best bet.

Unable to get correct map using gdirection load method when longitude and latitude are passed

I am using Gdirections google API. In that I am required to pass longitude and latitude in load method as parameters of source and destination. But when I pass longitude and latitude as parameters, it gives me a map with wrong directions. But when I pass source and destination address it gives me correct map.
How can I get a map with correct driving directions when lat and long is passed?
Here is one example of usage...
try below thing
gdir.loadFromWaypoints(["New Y...#40.714490,-74.007130", "NewJer...#40.072410,-74.728565"]);
Change New York and NewJer.. With the city or state you want..
Let me know it works for you or not.. Hope it helps..

Resources