Socket
Socket
Sign inDemoInstall

google-maps-infobox

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-maps-infobox

A browserify optimized module of google maps infobox


Version published
Weekly downloads
129K
decreased by-12.74%
Maintainers
1
Weekly downloads
 
Created

What is google-maps-infobox?

The google-maps-infobox npm package is a utility for creating customizable info boxes on Google Maps. It extends the functionality of the standard Google Maps InfoWindow, allowing for more flexible styling and positioning of the info boxes.

What are google-maps-infobox's main functionalities?

Customizable InfoBox

This feature allows you to create a highly customizable info box with specific styles, dimensions, and content. The code sample demonstrates how to initialize a Google Map and add a custom InfoBox with specific styling and content.

const map = new google.maps.Map(document.getElementById('map'), { center: { lat: -34.397, lng: 150.644 }, zoom: 8 });
const infobox = new InfoBox({ content: '<div class="infobox">Hello, World!</div>', disableAutoPan: false, maxWidth: 150, pixelOffset: new google.maps.Size(-140, 0), zIndex: null, boxStyle: { background: "url('http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/examples/tipbox.gif') no-repeat", opacity: 0.75, width: "280px" }, closeBoxMargin: "12px 4px 2px 2px", closeBoxURL: "http://www.google.com/intl/en_us/mapfiles/close.gif", infoBoxClearance: new google.maps.Size(1, 1), isHidden: false, pane: "floatPane", enableEventPropagation: false });
infobox.open(map);

Positioning InfoBox

This feature allows you to position the InfoBox at a specific location on the map. The code sample shows how to set the position of the InfoBox using latitude and longitude coordinates.

const map = new google.maps.Map(document.getElementById('map'), { center: { lat: -34.397, lng: 150.644 }, zoom: 8 });
const infobox = new InfoBox({ content: '<div class="infobox">Positioned InfoBox</div>', pixelOffset: new google.maps.Size(-50, -50) });
infobox.open(map);
infobox.setPosition(new google.maps.LatLng(-34.397, 150.644));

Event Handling

This feature allows you to handle events related to the InfoBox, such as when it is ready or when it is clicked. The code sample demonstrates how to add an event listener to the InfoBox that logs a message when the InfoBox is ready.

const map = new google.maps.Map(document.getElementById('map'), { center: { lat: -34.397, lng: 150.644 }, zoom: 8 });
const infobox = new InfoBox({ content: '<div class="infobox">Click me!</div>' });
infobox.addListener('domready', function() { console.log('InfoBox is ready!'); });
infobox.open(map);

Other packages similar to google-maps-infobox

Keywords

FAQs

Package last updated on 15 Mar 2017

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc