C# Bu HTML Dosyasını Çapırıyorum BingMaps Kodumda Aşağıda;
<script></script>
<script>
var map, searchManager;
function GetMap() {
map = new Microsoft.Maps.Map('#Mymap', {
entials: 'An2gx6HUPYmzRT3-8rwY5CPlUdATLmyjmbTErjzUtcb2XDI71yHSQ1rhAU_RSkBt'
});
map.setView({
center: new Microsoft.Maps.Location(39,116510, 35,810954)
});
//As the map view changes, update the WinForm app of the center and zoom level of the map.
Microsoft.Maps.Events.addHandler(map, 'viewchange', updateMapViewInfo);
//Update the map view info with the inital map view.
updateMapViewInfo();
}
function changeCenter(x, y) {
map.setView({
center: new Microsoft.Maps.Location(x, y),
});
}
function updateMapViewInfo() {
//Make sure that there is an external endpoint that can be accessed.
if (window.external) {
var center = map.getCenter();
//Call the UpdateMapViewInfo method in the Form1 class.
window.external.UpdateMapViewInfo(center.latitude, center.longitude, map.getZoom());
}
}
function updateMapWithPushpins(enlem, boylam, ad, color) {
var point = { latitude: enlem, longitude: boylam };
var pin = new Microsoft.Maps.Pushpin(point, {
title: ad,
color: color
});
//Add the pushpin to the map
map.entities.push(pin);
}
function focusToPin(enlem, boylam) {
map.setView({
center: new Microsoft.Maps.Location(enlem, boylam),
zoom: 50,
});
}
//A function that takes in a search query, geocodes it and displays it on the map.
function search(query) {
//If search manager is not defined, load the search module.
if (!searchManager) {
//Create an instance of the search manager and call the geocodeQuery function again.
Microsoft.Maps.loadModule('Microsoft.Maps.Search', function () {
searchManager = new Microsoft.Maps.Search.SearchManager(map);
search(query);
});
} else {
var searchRequest = {
where: query,
callback: function (r) {
//Add the first result to the map and zoom into it.
if (r && r.results && r.results.length > 0) {
var pin = new Microsoft.Maps.Pushpin(r.results[0].location);
map.entities.push(pin);
map.setView({ bounds: r.results[0].bestView });
}
},
errorCallback: function (e) {
//If there is an error, alert the user about it.
alert("No results found.");
}
};
//Make the geocode request.
searchManager.geocode(searchRequest);
}
}
</script>