New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@contentpilot/google-maps

Package Overview
Dependencies
Maintainers
4
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contentpilot/google-maps

JS used to display interactive Google Map with authenticated API key.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

Content Pilot Google Maps

JS used to display interactive Gogle Map with authenticated API key.

Install as devDependency

npm install @contentpilot/google-maps --save-dev

Require JS file in task runner

./node_modules/@contentpilot/google-maps/index.js

Bind to content area

$('.google-maps').cpGoogleMaps();

Authentication

  1. Sign up for APi key at https://console.cloud.google.com

  2. Add constants to functions.php

define( 'CHILD_THEME_GOOGLE_MAPS', 'API_KEY' );

define( 'CHILD_THEME_TEXTDOMAIN', 'theme-prefix' );

define( 'CHILD_THEME_VERSION', '1.0.0' );

  1. Enqueue URL with API key
add_action( 'wp_enqueue_scripts', 'theme_prefix_enqueue_google_maps_api' );
/**
 * Enqueue Google Maps API with key, only load after global JS
 *
 * @since  1.0.0
 */
function theme_prefix_enqueue_google_maps_api() {
	wp_enqueue_script(
		CHILD_THEME_TEXTDOMAIN . '-google-maps',
		'//maps.google.com/maps/api/js?key=' . CHILD_THEME_GOOGLE_MAPS,
		array( 'global' ),
		CHILD_THEME_VERSION,
		true
	);
}

Publish to NPM

To update this repository on NPM using the GitHub action,

  1. Bump the version number in package.json
  2. Commit with message pattern of Release x.x.x
  3. Push to master branch to origin

Keywords

FAQs

Package last updated on 17 Aug 2021

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