Create a pin (with heading and description for Google Maps) which is available for routes - iphone

I want to start the Maps application from my app. A pin with a correct heading and description (Address) should be shown on the Google map. Ideally the user should pick up this location and use it for a navigation.
I tried this:
1) http://maps.google.com/maps?ll=-33.874559,151.219575
Problem: No pin is shown on the map. The user can add a pin (it is automatically positioned on my before given location) and he can make a navigation etc. If the user has added the pin, he sees the correct address.
2) http://maps.google.com/maps?q=This+is+near+Lake+Shore+Drive#41.9288,-87.6315
Problem: Pin is shown on the map with a given heading. If the user taps the pin, he can't see the address (only latitude, longitude). If the user adds a pin (like in the example before) the position is somewhere in around my given location, but not there where I want. The user has to adjust the position by himself and than he can make a navigation to this point.
3) http://maps.google.com/maps?q=1+Infinite+Loop+Cupertino,CA+95014,USA+(somewhere)
Now I have a heading and a description field. The problem here is that the description is taking account and then there are ten pins shown (which contains a keyword from my description) instead of one.
Other possibilities:
4) Use of a kml-file
I don't want to store many kml-files somewhere on a server. Ideally some URL parameters for creating a kml-file would be fine. But I think there is no way for doing that.
5) Use of MapKit
If I would use MapKit I could create my own pin headings and descriptions. But there is nothing for the navigation I think.
Are there any other suggestions?

I made a combination of MapKit and Google Maps.

Related

Restart MKUserTrackingMode.FollowWithHeading

Code:
map.UserTrackingMode = MKUserTrackingMode.FollowWithHeading;
But after a user interacts with the map or after mKMapView.ShowAnnotations, the map automatically stops following the device's heading. (Not by my code. That's just how mkmapview works. This is also the case in the built in Maps app.)
How can I make the map start following the device's heading again from code?
This is exactly like how the Maps app works and is what the user will expect. The behavior you're describing is completely normal; you shouldn't interfere with it.
The usual thing is that you put an MKUserTrackingButton in the interface, associated with the map view, and the user can just tap it to switch modes automatically. Except for initially configuring the button, no code is needed.
https://developer.apple.com/documentation/mapkit/mkusertrackingbutton
or
https://developer.apple.com/documentation/mapkit/mkusertrackingbarbuttonitem

How can I access a pushpin already added on the map later with the help of some ID? (Bing maps V8)

I have a map where I have added many pushpins & have attached an id with each one of them.
Now, there's a listing of these locations on the right hand in list, I want to highlight a particular pin on click of it's corresponding listing. How do I access these pushpins with the help of id?
I simply want to do something like this: (This is just a random pseudocode, not an actual function)
var e=Microsoft.maps.getPushpin(someID);
Take a look at this code sample. It should how to create a list based on pushpin data and link it back to the pushpins themselves using an id: http://bingmapsv8samples.azurewebsites.net/#QueryAPI_Paging
Source Code: https://github.com/Microsoft/BingMapsV8CodeSamples/blob/master/Samples/Spatial%20Data%20Services/QueryAPI_Paging.html

Windows Phone 7 - Bing Maps MVVM Pushpin initialization

Does anyone have a good guideline on how to initialize a pushpin on the Bing Maps control?
My current scenario works, but is not 100% correct... let me explain the details:
When I open the page with the Bing Maps control on it, I want the user to be able to push a small button that will show his current location.
To show the current location, I'm using a Pushpin. I'm already adding the Pushpin on the control in the XAML file like this:
<map:Pushpin> x:Name="currentLocation" Location="{Binding CurrentLocation}" Content="Me" ManipulationStarted="CurrentLocationPin_ManipulationStarted" </map:Pushpin>
Now with this scenario there a some problems!
One, the pushpin is always visible! So how do I go about this? ( I know I can bind the Visibility also to a property and use a bool to visibility converter, but is this the best way to do this? )
Secondly, now I don't initialize the Location in the viewmodel... but for semantic reasons I would love to initialize the default value to Geocoordinate.Unkown ( that way I can use this to do checks when the user tries to do some manipulation before a currentlocation is set ). But when I initialize the pushpin on startup I get following error: "UIElement.Arrange(finalRect) cannot be called with Infinite or NaN values in finalRect.". So my question again :) what is a good guideline to setting up a currentlocation pushpin? ( but do mind that the users has to push a small application bar button before the currentlocation is set )
The initialization problem is due to the visibility of the Pushpin. If the initial visibility of the Pushpin is Collapsed, then it won't take part in the arrange pass, so you won't get the error.
If you're using a view model to back this view, then I don't see a problem with exposing a property from the view model that determines whether the Pushpin should be visibile or not. Yes you could use a boolean to visibility converter, but you could save some processing by actually exposing a Visibility property (which is the approach I've used).
If you're using a command to initiate showing the Pushpin from the button push (the Silverlight Windows Phone Toolkit has a behavior to enable hooking up application bar buttons to commands).

To display the title for the current loaction in map in iphone

I am new to iphone development. I have created map applications and i displayed the cuurent locations and drop a pin to the current location. now i want to display the title and subtitle of the current location when i am clicking the pin. Please help me out.
Thanks.
To display title and subtitle your annotation object you add to map must respond to -title and -subTitle messages (defined in MKAnnotation protocol as optional).
Edit: You can also obtain information about given location using MKReverseGeocoder class that queries google based servises for that and returns data via its delegate (see MKReverseGeocoderDelegate protocol).

How to remove the first pin while dropping consecutive pins in maps in iphone?

I am new to iphone development.I have created map applications and displayed the cuurent location and drop a pin to the current location.On clicking the button "Find Me", it drops a pin in my current location.Once again if i click the "Find Me" button it drops a pin but i am able to see the previously dropped pin in my current location. So i want to remove the previously dropped pin when i am clicking the "Find Me" button twice. Please help me out.
Thanks.
Store your annotation object somewhere and when you want to remove it just call -removeAnnotation: method with it:
[mapView removeAnnotation: annotationObject];
Note also that if you set your map view's showsUserLocation property to YES it will automatically track user location using Core Location framework services and display it on the map.