I'm facing some minor issues about setting the optimum view on Bing Maps.
I already got something in the internet solution but unfortunately none of them is working for me My Bing Map is displaying several addresses that are working fine and now I see the scene I want to adjust, so that my map is zooming on my push pin.
The following is my source code:
function addData (locationInput) {counter = 0; Var locationset = locationInput.split ("#"); // Array location = new array from the public; (If i == 0) {locationSet [0] = locationSet [0] .substr (1); (var i = 0; i & lt; locationInput.length; i ++); } Var locSet = locationSet [i] .split (";"); Var Location = New Microsoft. Map. Location (Locets [0], Loksat [1]); Locs.push (location); Var Pushpin = New Microsoft. Maps. Pushpin (location, {text: counter.Tosting ()}); Map.entities.push (pushpin); Counter ++; Console.log (this); } // Set the visual limits map.setView ({range: Microsoft map. Location location. (Place)}); }
When you calculate a location line from your places, then it's for coordinates Tight and do not have an account for the size of your push pin icon. You set the padding value in this account for this set. Try it:
map.setView ({boundary: Microsoft map.locationline.frame location (local), padding: 100});
No comments:
Post a Comment