You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-maps/migrate-from-google-maps-web-app.md
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: 'Tutorial - Migrate a web app from Google Maps to Microsoft Azure Maps'
3
3
description: Tutorial on how to migrate a web app from Google Maps to Microsoft Azure Maps
4
4
author: eriklindeman
5
5
ms.author: eriklind
6
-
ms.date: 12/07/2020
6
+
ms.date: 09/28/2023
7
7
ms.topic: tutorial
8
8
ms.service: azure-maps
9
9
ms.custom:
@@ -31,16 +31,15 @@ Also:
31
31
> * Best practices to improve performance and user experience.
32
32
> * Tips on how to make your application using more advanced features available in Azure Maps.
33
33
34
-
If migrating an existing web application, check to see if it's using an open-source map control library. Examples of open-source map control library are: Cesium, Leaflet, and OpenLayers. You can still migrate your application, even if it uses an open-source map control library, and you don't want to use the Azure Maps Web SDK. In such case, connect your application to the Azure Maps tile services ([road tiles]
35
-
\|[satellite tiles]). The following points detail on how to use Azure Maps in some commonly used open-source map control libraries.
34
+
If migrating an existing web application, check to see if it's using an open-source map control library. Examples of open-source map control library are: Cesium, Leaflet, and OpenLayers. You can still migrate your application, even if it uses an open-source map control library, and you don't want to use the Azure Maps Web SDK. In such case, connect your application to the Azure Maps [Render] services ([road tiles] | [satellite tiles]). The following points detail on how to use Azure Maps in some commonly used open-source map control libraries.
36
35
37
36
* Cesium - A 3D map control for the web. [Cesium documentation].
38
37
* Leaflet – Lightweight 2D map control for the web. [Leaflet code sample]\|[Leaflet documentation].
39
38
* OpenLayers - A 2D map control for the web that supports projections. [OpenLayers documentation].
40
39
41
40
If developing using a JavaScript framework, one of the following open-source projects may be useful:
42
41
43
-
*[ng-azure-maps] - Angular 10 wrapper around Azure maps.
42
+
*[ng-azure-maps] - Angular 10 wrapper around Azure Maps.
44
43
*[AzureMapsControl.Components] - An Azure Maps Blazor component.
45
44
*[Azure Maps React Component] - A react wrapper for the Azure Maps control.
46
45
*[Vue Azure Maps] - An Azure Maps component for Vue application.
@@ -53,7 +52,7 @@ If you don't have an Azure subscription, create a [free account] before you begi
53
52
* A [subscription key]
54
53
55
54
> [!NOTE]
56
-
> For more information on authentication in Azure Maps, see [manage authentication in Azure Maps].
55
+
> For more information on authentication in Azure Maps, see [Manage authentication in Azure Maps].
57
56
58
57
## Key features support
59
58
@@ -82,7 +81,7 @@ The following are some key differences between the Google Maps and Azure Maps We
82
81
* You first need to create an instance of the Map class in Azure Maps. Wait for the maps `ready` or `load` event to fire before programmatically interacting with the map. This order ensures that all the map resources have been loaded and are ready to be accessed.
83
82
* Both platforms use a similar tiling system for the base maps. The tiles in Google Maps are 256 pixels in dimension; however, the tiles in Azure Maps are 512 pixels in dimension. To get the same map view in Azure Maps as Google Maps, subtract Google Maps zoom level by the number one in Azure Maps.
84
83
* Coordinates in Google Maps are referred to as `latitude,longitude`, while Azure Maps uses `longitude,latitude`. The Azure Maps format is aligned with the standard `[x, y]`, which is followed by most GIS platforms.
85
-
* Shapes in the Azure Maps Web SDK are based on the GeoJSON schema. Helper classes are exposed through the [*atlas.data* namespace]. There's also the [*atlas.Shape*] class. Use this class to wrap GeoJSON objects, to make it easy to update and maintain the data bindable way.
84
+
* Shapes in the Azure Maps Web SDK are based on the GeoJSON schema. Helper classes are exposed through the [atlas.data] namespace. There's also the [atlas.Shape] class. Use this class to wrap GeoJSON objects, to make it easy to update and maintain the data bindable way.
86
85
* Coordinates in Azure Maps are defined as Position objects. A coordinate is specified as a number array in the format `[longitude,latitude]`. Or, it's specified using new atlas.data.Position(longitude, latitude).
87
86
> [!TIP]
88
87
> The Position class has a static helper method for importing coordinates that are in "latitude, longitude" format. The [atlas.data.Position.fromLatLng] method can often be replaced with the `new google.maps.LatLng` method in Google Maps code.
@@ -121,15 +120,15 @@ Both SDKs have the same steps to load a map:
121
120
122
121
**Some key differences**
123
122
124
-
* Google maps requires an account key to be specified in the script reference of the API. Authentication credentials for Azure Maps are specified as options of the map class. This credential can be a subscription key or Azure Active Directory information.
123
+
* Google Maps requires an account key to be specified in the script reference of the API. Authentication credentials for Azure Maps are specified as options of the map class. This credential can be a subscription key or Azure Active Directory information.
125
124
* Google Maps accepts a callback function in the script reference of the API, which is used to call an initialization function to load the map. With Azure Maps, the onload event of the page should be used.
126
125
* When referencing the `div` element in which the map renders, the `Map` class in Azure Maps only requires the `id` value while Google Maps requires a `HTMLElement` object.
127
126
* Coordinates in Azure Maps are defined as Position objects, which can be specified as a simple number array in the format `[longitude, latitude]`.
128
127
* The zoom level in Azure Maps is one level lower than the zoom level in Google Maps. This discrepancy is because the difference in the sizes of tiling system of the two platforms.
129
128
* Azure Maps doesn't add any navigation controls to the map canvas. So, by default, a map doesn't have zoom buttons and map style buttons. But, there are control options for adding a map style picker, zoom buttons, compass or rotation control, and a pitch control.
130
129
* An event handler is added in Azure Maps to monitor the `ready` event of the map instance. This event fires when the map has finished loading the WebGL context and all the needed resources. Add any code you want to run after the map completes loading, to this event handler.
131
130
132
-
The basic examples below uses Google Maps to load a map centered over New York at coordinates. The longitude: -73.985, latitude: 40.747, and the map is at zoom level of 12.
131
+
The following examples use Google Maps to load a map centered over New York at coordinates. The longitude: -73.985, latitude: 40.747, and the map is at zoom level of 12.
133
132
134
133
#### Before: Google Maps
135
134
@@ -228,7 +227,7 @@ Running this code in a browser displays a map that looks like the following imag
228
227
For more information on how to set up and use the Azure Maps map control in a web app, see [Use the Azure Maps map control].
229
228
230
229
> [!NOTE]
231
-
> Unlike Google Maps, Azure Maps does not require an initial center and a zoom level to load the map. If this information is not provided when loading the map, Azure maps will try to determine city of the user. It will center and zoom the map there.
230
+
> Unlike Google Maps, Azure Maps does not require an initial center and a zoom level to load the map. If this information is not provided when loading the map, Azure Maps will try to determine city of the user. It will center and zoom the map there.
232
231
233
232
**More resources:**
234
233
@@ -797,7 +796,7 @@ map.events.add('click', marker, function () {
797
796
798
797
Google Maps supports loading and dynamically styling GeoJSON data via the `google.maps.Data` class. The functionality of this class aligns more with the data-driven styling of Azure Maps. But, there's a key difference. With Google Maps, you specify a callback function. The business logic for styling each feature it processed individually in the UI thread. But in Azure Maps, layers support specifying data-driven expressions as styling options. These expressions are processed at render time on a separate thread. The Azure Maps approach improves rendering performance. This advantage is noticed when larger data sets need to be rendered quickly.
799
798
800
-
The following examples load a GeoJSON feed of all earthquakes over the last seven days from the USGS. Earthquakes data renders as scaled circles on the map. The color and scale of each circle is based on the magnitude of each earthquake, which is stored in the `"mag"` property of each feature in the data set. If the magnitude is greater than or equal to five, the circle is red. If it's greater or equal to three, but less than five, the circle is orange. If it's less than three, the circle is green. The radius of each circle will be the exponential of the magnitude multiplied by 0.1.
799
+
The following examples load a GeoJSON feed of all earthquakes over the last seven days from the USGS. Earthquakes data renders as scaled circles on the map. The color and scale of each circle is based on the magnitude of each earthquake, which is stored in the `"mag"` property of each feature in the data set. If the magnitude is greater than or equal to five, the circle is red. If it's greater or equal to three, but less than five, the circle is orange. If it's less than three, the circle is green. The radius of each circle is the exponential of the magnitude multiplied by 0.1.
801
800
802
801
#### Before: Google Maps
803
802
@@ -958,7 +957,7 @@ GeoJSON is the base data type in Azure Maps. Import it into a data source using
958
957
959
958
### Marker clustering
960
959
961
-
When visualizing many data points on the map, points may overlap each other. Overlapping makes the map looks cluttered, and the map becomes difficult to read and use. Clustering point data is the process of combining data points that are near each other and representing them on the map as a single clustered data point. As the user zooms into the map, the clusters break apart into their individual data points. Cluster data points to improve user experience and map performance.
960
+
When visualizing many data points on the map, points may overlap each other. Overlapping makes the map look cluttered, and the map becomes difficult to read and use. Clustering point data is the process of combining data points that are near each other and representing them on the map as a single clustered data point. As the user zooms into the map, the clusters break apart into their individual data points. Cluster data points to improve user experience and map performance.
962
961
963
962
In the following examples, the code loads a GeoJSON feed of earthquake data from the past week and adds it to the map. Clusters are rendered as scaled and colored circles. The scale and color of the circles depends on the number of points they contain.
Traffic data can be overlaid both Azure and Google maps.
1354
+
Traffic data can be overlaid both Azure and Google Maps.
1356
1355
1357
1356
#### Before: Google Maps
1358
1357
@@ -1391,7 +1390,7 @@ If you select one of the traffic icons in Azure Maps, more information is displa
1391
1390
1392
1391
### Add a ground overlay
1393
1392
1394
-
Both Azure and Google maps support overlaying georeferenced images on the map. Georeferenced images move and scale as you pan and zoom the map. In Google Maps, georeferenced images are known as ground overlays while in Azure Maps they're referred to as image layers. They're great for building floor plans, overlaying old maps, or imagery from a drone.
1393
+
Both Azure and Google Maps support overlaying georeferenced images on the map. Georeferenced images move and scale as you pan and zoom the map. In Google Maps, georeferenced images are known as ground overlays while in Azure Maps they're referred to as image layers. They're great for building floor plans, overlaying old maps, or imagery from a drone.
1395
1394
1396
1395
#### Before: Google Maps
1397
1396
@@ -1510,7 +1509,7 @@ Use the `atlas.layer.ImageLayer` class to overlay georeferenced images. This cla
1510
1509
1511
1510
### Add KML data to the map
1512
1511
1513
-
Both Azure and Google maps can import and render KML, KMZ and GeoRSS data on the map. Azure Maps also supports GPX, GML, spatial CSV files, GeoJSON, Well Known Text (WKT), Web-Mapping Services (WMS), Web-Mapping Tile Services (WMTS), and Web Feature Services (WFS). Azure Maps reads the files locally into memory and in most cases can handle larger KML files.
1512
+
Both Azure and Google Maps can import and render KML, KMZ and GeoRSS data on the map. Azure Maps also supports GPX, GML, spatial CSV files, GeoJSON, Well Known Text (WKT), Web-Mapping Services (WMS), Web-Mapping Tile Services (WMTS), and Web Feature Services (WFS). Azure Maps reads the files locally into memory and in most cases can handle larger KML files.
1514
1513
1515
1514
#### Before: Google Maps
1516
1515
@@ -1736,8 +1735,8 @@ Learn more about migrating to Azure Maps:
0 commit comments