What I would like to do is specify a location (for instance, a street corner in Paris) and have an MKMapView treat that as the user's current position. As the user moves away from his/her true position the deltas are reflected as changes to that "transposed" location. In other words: can I fool an MKMapView into "believing" that I am standing wherever I choose in the world and have it track my movements as though I were actually there?
Edit:
Actually, the real question is: Can I fool Core Location and thereby fool an MKMapView? The application wherein I would be displaying the transposed MKMapView would be interacting with Core Location.
Related
For an Android App I have created a custom overlay here, to display various items of game data on the map.
In general the overlay works fine and smoothly!
However there is one geometrical constellation which is not working as expected: Some objects within the overlay are not bound to geocoordinates, but to current user location. Now it happens, that Osmdroid is selectively redrawing the screen. When the screen is not focussed to user location, the user location bound stuff is not updated correctly: New stuff gets only drawn in some selective rectangle, old stuff isn't deleted outside that rectangle.
So far I failed to find a mechanism to communicate the required redraw of an overlay to the basic Osmdroid system? I.e. to invalidate the surroundings of the current user location? Any hint, clue or pointer?
By studying the sample code I realized they really consider it the overlay responsibility to issue appropriate invalidate calls to the map component to ensure their own optical integrity.
I am still struggling with the coordinates to do the right invalidate(left, top, right, buttom) calls cause my updates actually happen on location changes and it is unclear to me if the screen pixel of the map to be invalidated need to get measured relative to the old location or the new one. This is actually a timing question.
However taking the CPU byte and issuing postInvalidate() just looks as intended and it is unclear how much performance is really lost.
I am using CLLocationManager to retrieve current location in my app and display using MapView, i want to slide the map so that the current location should also change to the new location where the map slides and it should annotate to the new location, how to do it? Please give your suggestions with sample code.
You probably don't mean "the current" since that means where the phone actually is, unless you want to transport the phone to another place when using this app which would be quite a feat. So, how about drawing a layer over the top of your map that keeps a pin drawn at the centre so it looks as if the pin is moving over the map, but really the map is moving under the pin.
In the iPhone maps application under directions, if I try to search for directions with current location and the destination being a place ex:Shell gas station, sometimes it returns the result of the Shell station closest to my location. At other times this returns the address in some other state in the US. This happens randomly.
Any clues why this happens or any way to get around it ?
Searching for a point of interest (POI) in the Maps application tries to use the region defined by the visible map area to search. If that is too large an area, it uses your last known location. If you'd like it to search for shell gas stations near you, touch the 'current location' button and then do the search.
I am new to using MapKit on iPhone.
On Google Maps, I have a current location and push pins to indicate nearest places around current location. (The co-ordinates of all are hard-coded as on now).
Now, How to do the following:
1. Display a green arrow (right/left arrow) pointing to the nearest push pin location from current location?
2. How to play a voice saying "Take right for 1 mile" etc to reach nearest location from current location?
I don't have a definite solution but some ideas which might help you.
You can probably use a custom MKAnnotationView whose image will be the green arrow. You can then place this annotation (arrow) on top of your current location. Then you can find the closest pin (by checking its distance to the current location) and find the angle between the pin and the current location. With that angle you can rotate your arrow image so that it points towards the nearest pin.
You can get the user's current location and heading and you can get the distance from the current location to the nearest pin. With this information you can figure out how far and in what direction the user needs to travel. I'm not sure if you want to synthesize the voice or if you have audio files ready. You'll probably have to play back short clips back to back (eg "take" + "right" + "for" + "1" + "mile"). Have a look at Apple's audio programming guide. As far as I know, you can't get street-specific directions in the current mapkit (eg. turn right on Main street).
Good luck.
Is it possible to detect exactly how much finger is in contact with the screen? Say I wanted to make a fingerprinting app, how would I detect the outline of a person's fingeR?
No, the UITouch system does a lot of processing to determine a single point location for each touch given the larger touched area. This is meant to aid the user as there can be some difference between where one thinks he is touching and where the screen is actually touched.