Socket
Socket
Sign inDemoInstall

@types/google.maps

Package Overview
Dependencies
0
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/google.maps

TypeScript definitions for google.maps


Version published
Weekly downloads
1.5M
decreased by-13.16%
Maintainers
1
Install size
573 kB
Created
Weekly downloads
 

Package description

What is @types/google.maps?

The @types/google.maps package provides TypeScript type definitions for the Google Maps JavaScript API. It allows developers to use the API with TypeScript by offering types for classes, interfaces, and other constructs, enabling type checking and IntelliSense support in code editors.

What are @types/google.maps's main functionalities?

Map Initialization

This code initializes a new Google Map instance on the page, setting the zoom level and the center of the map.

{"const map = new google.maps.Map(document.getElementById('map'), { zoom: 4, center: { lat: -25.344, lng: 131.036 } });"}

Marker Placement

This code places a marker on the map at a specified latitude and longitude, and sets a title for the marker.

{"const marker = new google.maps.Marker({ position: { lat: -25.344, lng: 131.036 }, map: map, title: 'Hello World!' });"}

InfoWindow

This code creates an InfoWindow with some content and attaches it to a marker, so that it opens when the marker is clicked.

{"const infowindow = new google.maps.InfoWindow({ content: 'Uluru (Ayers Rock)' }); marker.addListener('click', function() { infowindow.open(map, marker); });"}

Directions Service

This code uses the Directions Service to calculate a route from Chicago to Los Angeles and then renders it on the map.

{"const directionsService = new google.maps.DirectionsService(); const directionsRenderer = new google.maps.DirectionsRenderer(); directionsRenderer.setMap(map); const request = { origin: 'Chicago, IL', destination: 'Los Angeles, CA', travelMode: 'DRIVING' }; directionsService.route(request, function(result, status) { if (status == 'OK') { directionsRenderer.setDirections(result); } });"}

Other packages similar to @types/google.maps

Readme

Source

Installation

npm install --save @types/google.maps

Summary

This package contains type definitions for google.maps (https://developers.google.com/maps/).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/google.maps.

Additional Details

  • Last updated: Sat, 06 Apr 2024 05:07:25 GMT
  • Dependencies: none

Credits

These definitions were written by Ken Nevarez, and Angela Yu.

FAQs

Last updated on 06 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc