iOS using GPS show the blue dot on an image? - ios

How do I make a image, make it georeferenced and make it such that using the GPS, a blue dot appears where I am standing (assuming the image is there) in my iOS application. How do I approach this to georeference my image and accomplish this?

The only way to do this would be to use MKMapView. There is a property you can set, -showsUserLocation, that will show the blue dot you need.
If you need to show this over the top of a specific image... you will have to get creative with it. Maybe loading a custom image for an annotation. It can be done, just depends on how big of a map you plan to show and what your use case is. Hope this helps.

The steps I would take are as follows :
Get the user's location using a location manager
Capture the image
Instead of saving it to the disk, copy the image to a new file named something like "imageprefix_(user location's latitude value)_(user location's longitude value).png"
Put an MKMapView in your UIViewController and set
[viewController.mapView showsUserLocation:YES]
Show the image below, or above. In the future, if you're not at that location, use the latitude and longitude values from the title of the image to drop an annotation on your mapView
Good luck!

Related

iPhone Xcode PDF MAP location GPS

I have a PDF map. What's the easiest way, to add a GPS "blue dot" with my location. Somehow to sync it with maps & add this PDF as a layer on top of that? Thanks
Here's a post on rendering a PDF to PNG. How to convert PDF to PNG efficiently?
You'll need to know the GPS coordinates at the top left and bottom right of the image that produces.
You can try creating an MKOverlay containing the image and define its MKMapRect based on those known coordinates.
If that doesn't work for some reason, you could use MKMapView's convert(_:toPointTo:) to tell you where those GPS coordinates are on a UIView that you manage yourself. (Heads up: that's more complicated than it seems)

UIButton with a custom asymmetric clickable region?

I have an image with various asymmetric regions, is it possible to place a button above each region?
The image will be something similar to this: https://cdn.dribbble.com/users/1557638/screenshots/4367307/proactive_d.png
After way too much research, I’ve decided to go with following solution for an image with multiple asymmetric clickable regions:
Duplicated the image file, colored each region with a different color, and stored as an asset.
Placed a simple tap gesture recognition over the displayed image. When tapped, I get the relative coordinate to the displayed image.
Get the color from the map image at the tapped coordinates.
Compare to a predefined enum.

How to show indoor annotations on MKMapView

I need to show an indoor floor plan in a MKMapView. So far I have managed to load custom map tiles into MKMapView. But when I try to show annotations it does not show in correct location. The space between latitudes are not equal. I think it’s because MKMapView maps the globe into flat surface. But in my case I need to show annotations in a flat surface. Any idea how to do this?
EDIT : Anyone know how to convert geographic coordinates to cartesian coordinates? That will solve this problem
Apple just updated its demo project:
https://developer.apple.com/library/prerelease/ios/samplecode/footprint/Introduction/Intro.html
Take a look, there are information about how to translate geolocation (spherical) to flat location.

IOS MKMapView sidewalk

Im working with Mapkit and I trying to draw a line in the "sidewalks" (border of the street),right now I'm looking for ideas on how I could start this task, thanks for your help.
notes: I know how to works with mkpolyline and coordinates
http://s30.postimg.org/7rnmdjzu9/mapa.png
You do not have access to the information that qualifies as a road inside the MKMapView. so, in order to be able to draw into the border of the street you will need to access the information that qualifies as a street (the coordinates of the road) or analyzing the view and changing the specific color represented by the border of the street (this is not public API, you will need to dig around the view hierarchy).

Put marker on the image in OpenCV

I'm showing an image using cv::imshow("binary1", binary1);. I want to put a marker on the image to the check the pixel locations. How can I put marker on the image for a particular row and column value?
It's difficult to understand what is it that you want to do, but I wrote a code a while back that displays the RGB color of a pixel along with it's coordinates on the title of the window. Move the mouse pointer over the image and you'll see it change.
It uses a Qt window, though. You can check cvImage.

Resources