Category Archives: API Code

Control Positioning in Google Maps

Introduction: In this tutorial we will see how the custom positioning of the Map is controlled. Most control choices have a position property (of type ControlPosition) that determines where the control should be placed on the map. The placement of these controls is not definite. Instead, the API wil...

Custom Controls In Google Maps

Introduction: In this tutorial, we will see the custom controls in Google Map API. You may develop your own controls to manage user interaction in addition to altering the design and location of existing API components. In contrast to overlays, which move with the underlying map, controls are immobi...

How to use the Default Controls in Maps?

Introduction: In this tutorial, we will learn how to create a map with the help of default controls available in Google Maps. Code: function initMap(): void { const map = new google.maps.Map( document.getElementById("map") as HTMLElement, { center: { lat: -34.397, lng: 150.644 }, zoom: 8, } ); } dec...

How to show Pixels and Tiles in Map?

Introduction: In this tutorial we will learn how to create a map which displays a window with the latitude, longitude, and world, pixel, and tile coordinates for Chicago, IL. Also, we will  show how these values change as the zoom level is adjusted. Code: function initMap(): void { const chicago = ...

How to get Geolocation of the User?

Introduction: The Geolocation API gives a location and accuracy radius based on cell tower and WiFi node information detected by the mobile client. The protocol used to deliver this data to the server and return a response to the client is described in this document. POST is used for HTTPS communica...