1.0.0 • Published 3 years ago

editorjs-googlemap v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
3 years ago

editorjs-googlemap

Editor.js Google map inline tools

npm.io

Features

Allows adding google map previews to your articles.

Installation

Install via NPM

Get the package

npm i --save-dev editorjs-googlemap

Include module at your application

const GoogleMap = require('editorjs-googlemap');

ES2015

import GoogleMap from 'editorjs-googlemap'

Download to your project's source dir

  1. Download folder dist from repository
  2. Add dist/bundle.js file to your page.

Usage

Add a new Tool to the tools property of the Editor.js initial config.

const editor = EditorJS({
  ...

  tools: {
    ...
    googleMap: {
      class: GoogleMap,
      place: 'Bangkok thailand',
      config: {
        placeholder: 'Place name or lat and long eg: 15.23999,-87.393993'
        searchValue: 'Search'
      }
    }
  },

  ...
});

Config Params

Link Tool supports these configuration parameters:

FieldTypeDescription
placeholderstringRequired: Placeholder on search input
searchValuestringRequired: Search button name

Output data

This Tool returns data with following format

FieldTypeDescription
placestringPlace name
{
    "type" : "googleMap",
    "data" : {
        "place": "Bangkok thailand"
    }
}

Also, it can contain any additional fields you want to store.