How to get Windows.Point from Lat/Long - vb.net

I am using the Bing Map Control for wpf on Windows 10. Given a Lat/Long location I need to get the Windows.Point value for that location. It should be relative to the map itself, namely, the upperleft corner (0,0). I use the Map.ViewportPointToLocation to go from a mouse location to the corresponding Lat/Long. Now I need the inverse function; I have not been able to find anything via web searches.

Try the maps TryLocationToViewportPoint or LocationToViewportPoint methods.
https://learn.microsoft.com/en-us/previous-versions/bing/wpf-control/hh709346(v=msdn.10)
https://learn.microsoft.com/en-us/previous-versions/bing/wpf-control/hh709336(v=msdn.10)

Related

ARCGIS API 4 -- Custom marker images for each point or address

There are several examples in the API, but for some reason, what I think the biggest feature is eluding me for some reason. I have a list of points and each point needs to be represented by a different icon. I also may have layers that use the same icon which I can find, just not the option for different icons/markers. An example of this would be greatly appreciated!!
I found out how to use the Graphic option to add an array of points that have a different url for their markers (symbols). This used the Picture Marker type. The beauty of JSON!!

MapKit how to get the Bezier path of a State

When i look at apple's Map, I can see the different bezier path of a specific place. I would like to know how to extact that information directly from the map. So let's say the user selects New York, I would like to highlight NEW York's Bezier path directly on the map. can this be done?
You will need an alternative form of data that ideally is very close to or exactly the same as the border being drawn by MapKit. You aren't going to get this from Apple.
Take a look at this blog post, where I accomplish the same thing with an open source framework (Mapbox GL) on the web:
http://justinmiller.io/posts/2015/01/20/anatomy-of-a-travel-map/
The ability to highlight areas like this should work in the iOS version of the toolkit as well (https://github.com/mapbox/mapbox-gl-cocoa) though you will not be able to do the interactivity directly in that framework.

Using d3.js to display a gps route on OpenStreetMap?

I'm thinking of using d3.js to display a gps route using OpenStreetMap as map.
I would like to be able to click anywhere along the route and get the corresponding location and timestamp. The gps locations can be anywhere around the world.
I'm new to the geo thing and not sure how to start or if this is a good approach.
/Lars

generate geo tiles from vector data

i am facing this problem : I have in my database some vector data (polylines ...) which describe many world/country/region/cities boundaries.
I would like to have an interactive map on thoses areas.
When i render those data in the browser (data are sent in geojson) this is slow (i'am not surprised).
The next reason, is to generate some raster tiles to represent the areas at different zoom level and to have a way to make the relation between a click on a area and the area selected (to display more info).
I am a newbie in geo tiles :
What is the best tool to generate png/jpg tiles from vector data?
How to make relation between an area clicked and a "id" in database?
I know my questions are very large, but if you have some advices ...
Thanks!
I recently wrote a blog posting on how to improve the rendering speed of raster tiles:
http://blog.webfoot.com/2013/03/12/optimizing-map-tile-generation/
As for connecting a click to a jurisdiction ID, I don't think there is a shortcut: you need to translate the click into lat/lng (or Vast Coordinate System, as I describe in the blog post) and then do a point-in-polygon check. If you are using PostGIS, then you can do an ST_Intersects.
NOTE: if you are using MySQL, the intersection is done with bounding boxes, not the polygons. It still is possible: you just need to grab a point-in-polygon function from somewhere to check which polygon if a bounding-box check gets you more than one.
Here is an example of dots you can click on:
http://maps.webfoot.com/demos/CanadianStimulus/CanadianStimulus.html
Note that because people aren't precise with clicking (especially with tiny dots), I actually make a few pixels around the dots "live" as well as the single-pixel dots. You can also click away from the dot, and then it will show the polygon (which in this example's case, is the federal electoral district).
There is a MongoDB Plugin datasource for Geoserver, a full featured WebGIS Server. You can use it to build up a map rendering service (a WMS actually) ofyour data. Then use Geowebcache to generate tiles of your map.
This way you can use fully featured WebGIS stack, which allows you to manage additional datasources, and easy tile subset recreation if portions of your data get updated.
Also querying features on a map (relation map position to element in database) is provided through Geoservers WFS implementation.

MKMapKit and google tile location

i am trying to add some MKOverlays to a MKMapKit. I'll be using our WMS server to fetch tiles based on google's grid location standard and adding them. To make the call, i need to tell our WMS server the google tile (x, y, and zoom level).
i've looked over apple's TileMap sample code which looks like it uses google's tile system.
Does MKMapKit return this information or do i need to derive it from GPS coords?
You have to derive it yourself. I found this sample very useful:
https://github.com/mtigas/iOS-MapLayerDemo