Editor.js Google map inline tools
Allows adding google map previews to your articles.
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'
dist
from repositorydist/bundle.js
file to your page.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'
}
}
},
...
});
Link Tool supports these configuration parameters:
Field | Type | Description |
---|---|---|
placeholder | string |
Required: Placeholder on search input |
searchValue | string |
Required: Search button name |
This Tool returns data
with following format
Field | Type | Description |
---|---|---|
place | string |
Place name |
{
"type" : "googleMap",
"data" : {
"place": "Bangkok thailand"
}
}
Also, it can contain any additional fields you want to store.