BING MAPS Windows Store Pushpin MapView - bing-maps

I have a Map on my Windows Store app that adds multiple pushpins.
Is there any way to have the map control "MapVew/ZoomLevel" automatically adjust to always zoom to a level where all the pushpins are visible?
Thanks in advance.
/Eric

Should be pretty easy to do:
Get a LocationRect from your list of Pushpin coordinates
Call SetView on your map and pass it the LocationRect
Redo step 1 & 2 each time your collection of visible Pushpins change.

Related

Infobox in Bing V8 maps get cropped when pushpin is near map boundary

I am displaying map infobox when I click on a pushpin in Bing V8 maps. The infobox moves out of the map boundary(cropped) when pushpin is near edges of map boundary. Is there any inherent way of solving it or we have to perform the tedious task of repositioning infobox or the map itself in order to show complete infobox.
There are two options:
Move the map when a user clicks on the pushpin and then display the infobox, often users will center the map on the clicked pushpin (ideal for mobile solutions).
When loading the map, add the following map option; allowInfoboxOverflow: true This will allow the infobox to appear outside the map edges and overflow. This is better suited in non-mobile apps.

Mapbox: Center map after popup closes

I have a mapbox project that I need to be able to re-center the map when a popup closes. Right now, clicking a marker will pan the map and after the user closes the popup they are left with the map panned over to the new location. I simply need the map to recenter to the original location I set as my map center.
I've not found a method using the mapbox api so I don't have any code to start. I'm more looking for someone who might have experience with such a configuration.
Since mapbox.js is built on top of leaflet you can use the Leaflet API.
You can listen for popupclose events. Then you can call map.setView() and center the map at the original position.
Here is a working example

Leaflet/Mapbox Markers Don't Repeat After Scrolling Around the Atlas

Screenshot from Mapbox docs:
It seems as though Mapbox won't render given coordinates multiple times on the same map, even if the map is zoomed out far enough to view the same latitude and longitude pairing twice. Is there a way around this?
Use the worldCopyJump option of L.mapbox.map (L.map):
With this option enabled, the map tracks when you pan to another "copy" of the world and seamlessly jumps to the original one so that all overlays like markers and vector layers are still visible.
Working example on Plunker: http://plnkr.co/edit/cbDNH6Rs5SbBKGY7LQGe?p=preview
Reference: http://leafletjs.com/reference.html#map-worldcopyjump

Mapbox zoom to location based on url

I have a main map landing page of the U.S. which shows my map and all the pins on it, then there are individual pages for each state with specific content related to them, that also show the map. I am wondering if it is possible to have the map zoom into the states location when that url is clicked. e.g. When you click to go to the Colorado page, the map zooms and centers on Colorado, instead of going to the default view on the main map landing page.
It would work like the geocoder, if you type Colorado, it zoom and centers on the state.
The initially position map with geocode example is probably close to what you're looking for.

how to get current location as i slide the MapView?

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.