ESRI ArcGIS : location point [using lat, long] is not rendering at correct position on arcGIS map - arcgis

I am working on a web app where I need to render the point location on a map using latitude and longitude values returned from the tracking device.
When I render lat & long positions on a map, it is some meters offset from the actual location.
Actual location of device:
Verified from location tracker app
Marker point when I render on ArcGIS map:
You can see it is not rendering at the correct location
For reference, I have created a pen for this issue
codepen: https://codepen.io/navtej887/pen/xxVXGYV
Is this the right way to render a lat-long position on the map?

Related

Get coordinates and city when moving marker draggable mapbox gl

I have a map in mapbox which has a draggable marker, when I move the marker I am getting its coordinates and I save them in a store, but I also want to get the location, be it the city and the street or something more specific, is there a way to get this data in mapboxgl?
You are describing reverse geocoding, a service that the Mapbox Geocoding API provides. You can feed the lng/lat coordinates you get after moving the marker into this API to get back location data for that position.

Augmented Reality with React Native (Points of Interest over the camera)

I'm working on an application for Android & iOS to show points of interest over the camera. ARkit & ARcore has poor compatibility nowdays.
Could you recommend me some library to do this? If it comes with an example, better! I know viro-media, but I don't understand how to do this using that library.
I don't want 3D models, just markers over the camera, similar to the attachment image.
To do this with Viro React -- and in AR in general -- the trick is to recognize that there are two coordinate systems:
The local coordinate system of your device, which we'll call 'AR space'. In Viro, this is centered at the user's initial position when the application starts, and is in meters.
Geographic coordinates (latitude and longitude).
To position the overlays, you have to convert your content from geographic coordinates into AR space. This is a two-step process. First project the spherical geographic coordinates onto a 2D plane -- the Web Mercator is great for this. Then translate the projected coordinates by the device's initial projected position.
The device's initial projected position can be derived by projecting its initial geographic position. In Viro React, you can use the Geolocation module to grab this when the user starts the app.
Finally, you'll need to do a similar transformation for the user's bearing: converting from compass direction to device orientation in AR space.
For this to work well you'll likely have to figure out how handle inaccurate geolocation lookups (e.g. what happens if the location retrieved from the device is inaccurate), and may also have to account for drift: over time the two coordinate systems may start to fall out of sync.
The last part, creating the info cards, is easy with Viro -- you either pre-bake the images with text and use ViroImage, or if the cards need to be more dynamic you can use a ViroFlexView.
I am also interested in this one and I'm trying out ViroReact!
I find a bit difficult to understand how to make this work when the lat's and long's have been converted to x-y-values. What should the z-value be?
Let's say you have the lat-lon coordinates [59, 10] as the user location you want to show where [59, 11] is relative to your location. How to you build that in a ViroARScene?
<ViroNode position={ **userLocationFromLatLonCartesian** }>
<ViroBox position={ **poiLocationFromLatLonToCartesian** }/>
</ViroNode>
So how do you calculate the scale, position and rotation, so that the object will be visible?
Seem like https://github.com/proj4js/proj4js is a library that could provide conversions from latlon to x-y values
I found that both android and ios AR sdk support location base AR View refererence:
https://developers.google.com/ar/develop/ios/geospatial/quickstart and https://developer.apple.com/documentation/arkit/argeoanchor

Get latitude and longitude values from MapBox MBTiles

I am new to MapBox and using it for offline maps. How i can get latitude and longitude values when i tap on MapBox MBTiles. MBTiles has world map along with country names. Also can i get current location using MBTiles with GPS chip on and WiFi/3G off with MapBox? Any suggestion or source code regarding this will be helpful.
The API you want is -[RMMapViewDelegate singleTapOnMap:].

How to get coordinates of corners of visible bing map?

I'm using Bing Maps in a windows 8 app and I need to display pushpins at numerous locations.
Is there any way to get the GPS coordinates of the corners of the visible map?
Or alternatively a way to get the distance of the visible map? (e.g. 40km width, 60km height)
I need this in order to limit the number of pushpins I attach to the map to just being the ones on the visible part of the map.
You can get this information directly from the Bounds property of the map instance, which returns a LocationRect defined by the Northwest and Southeast lat/lng locations shown in the current view.
http://msdn.microsoft.com/en-us/library/hh846504.aspx
Try using the TryPixelToLocation method.
Location locationOfPixel
if(MyMap.TryPixelToLocation(ThePointToLookUp, out locationOfPixel))
{
//locationOfPixelshould contain the lat/long of the give point on the map.
}
Obviously, you will need to work out what the pixel locations of the top left, top right, bottom left and bottom right of your map control are and pass them in accordingly.

Adapt a drawn overlay to match roads

In my application I can draw an overlay (PolyLine) on my map (MKMapView). This overlay however, is not bounded to actual roads. Is there a way (some API or others) to adapt the overlay so that it covers/overlays a real road.
The application is run on mobile devices (iPod Touch & iPhone), so to not make my app a very battery consuming one, I would set the Core Location Accuracy not to the highest. As a result, the location will be a bit next to the road where you are. Then I would still like my program to adjust this error...
To get an overlay that matches actual roads, I used Google Maps API Webservices. I already had an array of all points forming a route and I used these points (coordinates) to easily create an overlay that maps on real roads.
I used the first and last point to create a navigation between and set all the other points as 'waypoints', see Directions API
To find the nearest address of a point, I used the Geocoding API
Google Maps API Webservices: http://code.google.com/intl/nl-NL/apis/maps/documentation/webservices/