Skip to content

Latest commit

 

History

History
32 lines (28 loc) · 1.22 KB

customize-map-options-on-load-example.md

File metadata and controls

32 lines (28 loc) · 1.22 KB
title description ms.custom ms.date ms.reviewer ms.suite ms.tgt_pltfrm ms.topic ms.assetid caps.latest.revision author ms.author manager ms.service
Customize Map Options on Load Example | Microsoft Docs
This article provides a code to update how the map is loaded in the GetMap function such that it sets the type to aerial, the zoom level to 10, and the map center over London, UK (51.50632, -0.12714).
02/28/2018
article
8a5266da-eabb-459c-86e0-b068bd6b2dab
2
rbrundritt
richbrun
stevelom
bing-maps

Customize Map Options on Load Example

You can customize the map as you load it. Use the following code to update how the map is loaded in the GetMap function such that it sets the type to aerial, the zoom level to 10, and the map center over London, UK (51.50632, -0.12714).

var map = new Microsoft.Maps.Map('#myMap', {
    credentials: 'Your Bing Maps Key',
    center: new Microsoft.Maps.Location(51.50632, -0.12714),
    mapTypeId: Microsoft.Maps.MapTypeId.aerial,
    zoom: 10
});

This results in the map being loaded, zoomed in over London, UK with the aerial imagery displayed.

London Aerial Sample Image