Pushpin infobox windows phone




















In the constructor MainWindow you can see that we set up the handler for the double-click event. This is standard. NET code. Handled to true. Otherwise the map control will try to handle the click itself as well, making it zoom-in every time we add a push pin. In the next two lines we try to retrieve the exact location where we clicked.

This can all be viewed in the MSDN documentation and is standard behavior. At line 24 we add the Pushpin to the map so that it will be shown. You can now run this application and start double clicking on the map yourself. Edit the event handler for the Pushpin click as follows. As you can see we set the event as being handled again at line 3.

The sender of the event should be a Pushpin, so we verify this first and then try to obtain the value of the content of the pin itself. After that, we set the heading of the map, which is the rotation.

If you now run the application and start clicking the Pushpins after adding a few , the map should rotate, but the Pushpins should not. We can easily fix this by binding the heading property of the Pushpin itself, to the heading of the map control.

This can be done by the following code, which should be placed directly before we add the Pushpin to the map control. We will now start customizing the Pushpin to make it show completely different from the default Pushpins.

For this we need to create a ControlTemplate in the xaml file. First add a section for static resources in the root object, the Window.

Then add the template for the Pushpin. This we will bind to our Pushpins later. Directly behind it I placed another rectangle that I skewed and rotated a bit to make it look a bit like a balloon. This setting of the PositionOrigin is important to us, because our customized Pushpin should be placed to the top and to the right of where we click. Thanks for your feedback. Hi Claudeir, Thank you for the answer! I researched your links carefully: - Report a Concern to Bing helps to report a concern about a search result's bad content, not a bug or technical question.

This will ensure that the experts can focus on resolving user's problems instead of having to redirect you to the right site. Bing Map Answers forum - we are here now. Enterprise Customer Support link - we do not have an enterprise license because we do not use Bing Map directly, but implement a wrapper for our users.

So seems like the single way to get help is to wait for an answer here. Or, am I missing something? This is a perfectly acceptable forum for your question. I will raise this issue to the Maps Team and have them review. It might be that the control is waiting for the browser to force a memory release by it's garbage handler. Are you in a forced low memory situation when you would expect the browser to free the memory?

Have you any more details? Is this maybe just due to lazy garbage collection in the browser? When we create the pushpin we will store the title and description inside the Tag property of the pushpin. We will then add a Tapped event which we will use to open our infobox. Finally, we will add the pushpin to the layer. SetPosition p, latlong ; p. When the user taps the pushpin, we will take the metadata we stored in the pushpin and bind it to the Infobox. We will then make the infobox visibility and then use the MapLayer to set the position of the infobox.

We now have all the code we need to create pushpins that open up an Infobox when tapped. All we need to do now is create some pushpins.

To do this, update the constructor to look like this:. If you click on any of them, you will see an infobox appear with details for that pushpin. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info.



0コメント

  • 1000 / 1000