Skip to content

Commit a1557a4

Browse files
authored
Merge pull request #253200 from stevemunk/render-v1-deprecation-4
Updates to "Migrate web service from Google Maps"
2 parents 61e35f0 + 11b2dda commit a1557a4

File tree

2 files changed

+114
-112
lines changed

2 files changed

+114
-112
lines changed

articles/azure-maps/migrate-from-google-maps-web-app.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: 'Tutorial - Migrate a web app from Google Maps to Microsoft Azure Maps'
33
description: Tutorial on how to migrate a web app from Google Maps to Microsoft Azure Maps
44
author: eriklindeman
55
ms.author: eriklind
6-
ms.date: 12/07/2020
6+
ms.date: 09/28/2023
77
ms.topic: tutorial
88
ms.service: azure-maps
99
ms.custom:
@@ -31,16 +31,15 @@ Also:
3131
> * Best practices to improve performance and user experience.
3232
> * Tips on how to make your application using more advanced features available in Azure Maps.
3333
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.
3635

3736
* Cesium - A 3D map control for the web. [Cesium documentation].
3837
* Leaflet – Lightweight 2D map control for the web. [Leaflet code sample] \| [Leaflet documentation].
3938
* OpenLayers - A 2D map control for the web that supports projections. [OpenLayers documentation].
4039

4140
If developing using a JavaScript framework, one of the following open-source projects may be useful:
4241

43-
* [ng-azure-maps] - Angular 10 wrapper around Azure maps.
42+
* [ng-azure-maps] - Angular 10 wrapper around Azure Maps.
4443
* [AzureMapsControl.Components] - An Azure Maps Blazor component.
4544
* [Azure Maps React Component] - A react wrapper for the Azure Maps control.
4645
* [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
5352
* A [subscription key]
5453

5554
> [!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].
5756
5857
## Key features support
5958

@@ -82,7 +81,7 @@ The following are some key differences between the Google Maps and Azure Maps We
8281
* 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.
8382
* 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.
8483
* 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.
8685
* 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).
8786
> [!TIP]
8887
> 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:
121120

122121
**Some key differences**
123122

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.
125124
* 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.
126125
* 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.
127126
* Coordinates in Azure Maps are defined as Position objects, which can be specified as a simple number array in the format `[longitude, latitude]`.
128127
* 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.
129128
* 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.
130129
* 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.
131130

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.
133132

134133
#### Before: Google Maps
135134

@@ -228,7 +227,7 @@ Running this code in a browser displays a map that looks like the following imag
228227
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].
229228

230229
> [!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.
232231
233232
**More resources:**
234233

@@ -797,7 +796,7 @@ map.events.add('click', marker, function () {
797796

798797
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.
799798

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.
801800

802801
#### Before: Google Maps
803802

@@ -958,7 +957,7 @@ GeoJSON is the base data type in Azure Maps. Import it into a data source using
958957

959958
### Marker clustering
960959

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.
962961

963962
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.
964963

@@ -1352,7 +1351,7 @@ map.layers.add(new atlas.layer.TileLayer({
13521351

13531352
### Show traffic data
13541353

1355-
Traffic data can be overlaid both Azure and Google maps.
1354+
Traffic data can be overlaid both Azure and Google Maps.
13561355

13571356
#### Before: Google Maps
13581357

@@ -1391,7 +1390,7 @@ If you select one of the traffic icons in Azure Maps, more information is displa
13911390

13921391
### Add a ground overlay
13931392

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.
13951394

13961395
#### Before: Google Maps
13971396

@@ -1510,7 +1509,7 @@ Use the `atlas.layer.ImageLayer` class to overlay georeferenced images. This cla
15101509

15111510
### Add KML data to the map
15121511

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.
15141513

15151514
#### Before: Google Maps
15161515

@@ -1736,8 +1735,8 @@ Learn more about migrating to Azure Maps:
17361735
> [!div class="nextstepaction"]
17371736
> [Migrate a web service]
17381737
1739-
[*atlas.data* namespace]: /javascript/api/azure-maps-control/atlas.data
1740-
[*atlas.Shape*]: /javascript/api/azure-maps-control/atlas.shape
1738+
[atlas.data]: /javascript/api/azure-maps-control/atlas.data
1739+
[atlas.Shape]: /javascript/api/azure-maps-control/atlas.shape
17411740
[`atlas.layer.ImageLayer.getCoordinatesFromEdges`]: /javascript/api/azure-maps-control/atlas.layer.imagelayer#getcoordinatesfromedges-number--number--number--number--number-
17421741
[Add a Bubble layer]: map-add-bubble-layer.md
17431742
[Add a circle to the map]: map-add-shape.md#add-a-circle-to-the-map
@@ -1831,7 +1830,7 @@ Learn more about migrating to Azure Maps:
18311830
[Load a map]: #load-a-map
18321831
[Localization support in Azure Maps]: supported-languages.md
18331832
[Localizing the map]: #localizing-the-map
1834-
[manage authentication in Azure Maps]: how-to-manage-authentication.md
1833+
[Manage authentication in Azure Maps]: how-to-manage-authentication.md
18351834
[Marker clustering]: #marker-clustering
18361835
[Migrate a web service]: migrate-from-google-maps-web-services.md
18371836
[ng-azure-maps]: https://github.com/arnaudleclerc/ng-azure-maps
@@ -1844,9 +1843,10 @@ Learn more about migrating to Azure Maps:
18441843
[Popup options]: /javascript/api/azure-maps-control/atlas.popupoptions
18451844
[Popup with Media Content]: https://samples.azuremaps.com/?sample=popup-with-media-content
18461845
[Popups on Shapes]: https://samples.azuremaps.com/?sample=popups-on-shapes
1846+
[Render]:  /rest/api/maps/render-v2
18471847
[Reusing Popup with Multiple Pins]: https://samples.azuremaps.com/?sample=reusing-popup-with-multiple-pins
18481848
[road tiles]: /rest/api/maps/render-v2/get-map-tile
1849-
[satellite tiles]: /rest/api/maps/render/getmapimagerytile
1849+
[satellite tiles]: /rest/api/maps/render-v2/get-map-static-image
18501850
[Search Autosuggest with JQuery UI]: https://samples.azuremaps.com/?sample=search-autosuggest-and-jquery-ui
18511851
[Search for points of interest]: map-search-location.md
18521852
[Setting the map view]: #setting-the-map-view

0 commit comments

Comments
 (0)