Socket
Socket
Sign inDemoInstall

@types/googlemaps

Package Overview
Dependencies
0
Maintainers
1
Versions
112
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/googlemaps


Version published
Maintainers
1
Created

Package description

What is @types/googlemaps?

@types/googlemaps provides TypeScript type definitions for the Google Maps JavaScript API, enabling developers to use Google Maps functionalities with type safety and autocompletion in TypeScript projects.

What are @types/googlemaps's main functionalities?

Map Initialization

This feature allows you to initialize a Google Map with a specified center and zoom level.

const map = new google.maps.Map(document.getElementById('map'), { center: { lat: -34.397, lng: 150.644 }, zoom: 8 });

Adding Markers

This feature allows you to add markers to the map at specified locations.

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

Geocoding

This feature allows you to convert addresses into geographic coordinates and place markers on the map.

const geocoder = new google.maps.Geocoder(); geocoder.geocode({ 'address': 'Sydney, NSW' }, function(results, status) { if (status === 'OK') { map.setCenter(results[0].geometry.location); const marker = new google.maps.Marker({ map: map, position: results[0].geometry.location }); } else { alert('Geocode was not successful for the following reason: ' + status); } });

Drawing Shapes

This feature allows you to draw shapes like rectangles on the map, with options to make them editable and draggable.

const rectangle = new google.maps.Rectangle({ bounds: { north: 33.685, south: 33.671, east: -116.234, west: -116.251 }, editable: true, draggable: true }); rectangle.setMap(map);

Other packages similar to @types/googlemaps

Readme

Source

Installation

npm install --save @types/googlemaps

Summary

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

Details

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

Additional Details

  • Last updated: Wed, 09 Dec 2020 12:05:01 GMT
  • Dependencies: none
  • Global values: google

Credits

These definitions were written by Chris Wrench, Kiarash Ghiaseddin, Grant Hutchins, Denis Atyasov, Michael McMullin, Martin Costello, Sven Kreiss, Umar Bolatov, Michael Gauthier, Colin Doig, Dmitry Demensky, Vladimir Dashukevich, Simon Haenisch, Gavin Nitta, Bat-Orshikh Baavgaikhuu, and Justin Poehnelt.

FAQs

Last updated on 09 Dec 2020

Did you know?

Socket

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc