How do I create an app that would takes map coordinates & map size enter by a user, and then draws that desired map? I looked, couldn't fine any video either. All the map tutorial show is how to create a app for your current location.
Thank
Most of the examples you've found are totally valid, you only need to provide the coordinates of the map you want to display in addition to that. That's the easy part...
It's usually as easy as
MKCoordinateRegion region = MKCoordinateRegionMake (60,0,1.5, 1.5);
[mapView setRegion: region];
Related
I have tried a few solutions but haven't found one that works for me. Basically, when a button is pressed on my mapview, I want to zoom in as far as MapKit allows, with the user location centered. I keep trying to manipulate the distance parameters, but it seems below a certain point that no longer works...the map view will only zoom to a certain distance, but I can manually pinch and zoom further beyond that. Obviously I don't expect it to give me a 10x10m map...but as close as possible.
Actually, ideally I'd like to do this in combination with using the "follow with heading" tracking mode...but I've found that setting this property will automatically set the zoom level to some predefined point, which is annoying. I think I'll have to manually track heading and rotate the map...a little frustrating that the API doesn't give us a little more flexibility. And it seems like "[mapView maxZoom]" would be a really useful call, but I've found no such thing...what am I missing?
-(void)zoomAndCenterMap
{
CLLocationCoordinate2D coord = self.mapView.userLocation.coordinate;
MKCoordinateRegion viewRegion = MKCoordinateRegionMakeWithDistance(coord, 10, 10);
MKCoordinateRegion adjustedRegion = [self.mapView regionThatFits:viewRegion];
[self.mapView setRegion:adjustedRegion animated:YES];
}
A maxZoom API does indeed not exist in MapKit. I've added a method to a subclass of MKMapView over in another project that might be of use. Then you could at least figure out what the max zoom level is and maybe programmatically go to it.
Is it possible to somehow show the locations (annotations) from the map to a custom world image.
I have the coordinates in decimal value (42.0012,21.4167) and I want to show that location on a custom UIImage. I guess I would probably need to convert this coordinates (42.0012,21.4167) to a screen coordinates (x,y), but how big should the UIImage be?
I found a lot of material online but I got so confused that I dont know where to start from. Can anyone point me on the right track?
I've looked into TileMap and route-me but I really need some guidance.
is there any kind of way to input the coordinates for two locations, a startpoint and a destination, and get an image result (jpeg) of a map, say google map, showing the two locations on that same image?
I need this for a vb application
thanks!
Update:
I've successfully added the image with the two locations, but there's a tiny issue,
what if the two places are too close or too far from each other, the zooming should differ, and maybe the size too, what is the best way to manipulate these, according to the coordinates given?
Yes, you can use the Static Maps API to get the map image:
https://developers.google.com/maps/documentation/imageapis/
I have a UIImageView that is undergoing a simple translation animation, and I am trying to get the coordinates of the view while it is moving via the imageview.frame.origin.x property. However, it is giving me the coordinates that the imageview will be at after the animation. Is there any way to get the current coordinates?
Yes, you need to check the coordinates of the presenationLayer. You can read a detailed description about it in my blog post about tapping moving layers.
Is it possible to make a marker draggable and to get its coordinates in gmaps4rails, that the user could drag marker to choose the point he wants and get his chosen point coordinates?
It's not implemented in the gem.
But don't forget that you have access to all objects created. Example, the map could be retrieved with: Gmaps4Rails.map
You could take inspiration from: https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Javascript-goodies