Skip to content

Simple Flow for Add, custom Button and Save #936

Discussion options

You must be logged in to vote

To create custom buttons you can take a look into Custom Control.

Create a copy of the Circle control with a custom title:

map.pm.Toolbar.copyDrawControl('Circle',{
  name: 'CircleTask', 
  title:'Add Task',
  block: 'draw'
});

To overwrite the tooltips of the Circle you can change the translation strings:

const customTranslation = {
  tooltips: {
    startCircle: 'Add Task',
    finishCircle: 'Click to finish Task'
  },
};

map.pm.setLang('custom_en', customTranslation, 'en');

To create a custom button to execute code like "store on db" you can use this:

// add a new custom control
map.pm.Toolbar.createCustomControl({
  name: 'StoreShapes', 
  title:'Store all shapes',
  block: 'custom…

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
5 replies
@bencote
Comment options

@bencote
Comment options

@Falke-Design
Comment options

@bencote
Comment options

@Falke-Design
Comment options

Answer selected by Falke-Design
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@cubecleveland
Comment options

@Falke-Design
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants