Comments in the code...
\documentclass[a4paper]{article}
\usepackage{pgfkeys} %no need to full-load tikz
\pgfkeys{%/tikz/.cd, you want your top-family, no?
% /map/.is family,
% /map/.cd, %<-added .cd why?
/map/.is choice,
% /map/.default=false, % not useful in choices, you have to call one of them anyway
/map/true/.code={S1 S2 S3},
/map/false/.code={S0},
}
\newcommand{\cmd}[1][false]{%
\pgfkeys{/map=#1}
}
\begin{document}
Test:
\cmd[true]
\cmd % if you use \cmd[] you ends with /map= which is not a choice
\end{document}

Notice that true
and false
are fully customizable here --- you can call them whatever you want, they're just names.
Anyway, I would rather separate the key management and the code. So I will
- define a top family for my application
- add a specific function to set keys in this family
- use the keys to switch/set things
Like this:
\documentclass[a4paper]{article}
\usepackage{pgfkeys}
\newif\ifdomap\domapfalse
\pgfkeys{
/cis/.is family, /cis/.cd,
map/.is choice,
map/true/.code={\domaptrue},
map/false/.code={\domapfalse},
}
\newcommand{\cisset}[1]{\pgfkeys{/cis/.cd, #1}}
\newcommand{\cmd}[1][]{%
\begingroup % change the keys locally
\cisset{#1}%
\ifdomap
S1 S2 S3
\else
S0
\fi
\endgroup
}
\begin{document}
Test:
\par No map: \cmd
\par Map (locally): \cmd[map=true]
\par No map: \cmd
\par Set globally to true \cisset{map=true}
\par Map: \cmd
\par No map (locally): \cmd[map=false]
\par Set globally to false \cisset{map=false}
\par No map: \cmd
\end{document}

This is a bit low level, you can use xifthen
package if you are addressing just LaTeX.
If you want a simple map
key, you just do not use the is choice
handler:
\documentclass[a4paper]{article}
\usepackage{pgfkeys}
\newif\ifdomap
\pgfkeys{
/cis/.is family, /cis/.cd,
map/.code={\domaptrue},
no map/.code={\domapfalse},
no map % set the default
}
\newcommand{\cisset}[1]{\pgfkeys{/cis/.cd, #1}}
\newcommand{\cmd}[1][]{%
\begingroup % change the keys locally
\cisset{#1}%
\ifdomap
S1 S2 S3
\else
S0
\fi
\endgroup
}
\begin{document}
Test:
\par No map: \cmd
\par Map (locally): \cmd[map]
\par No map: \cmd
\par Set globally to true \cisset{map}
\par Map: \cmd
\par No map (locally): \cmd[no map]
\par Set globally to false \cisset{no map}
\par No map: \cmd
\end{document}

And finally, this allows to have both the map
switch and a map=...
switch, similar to lot of options in TikZ. This uses an auxiliary key and a style with an (optional, thanks to the .default
) argument.
\documentclass[a4paper]{article}
\usepackage{pgfkeys}
\newif\ifdomap
\pgfkeys{
/cis/.is family, /cis/.cd,
domap/.is choice,
domap/false/.code={\domapfalse},
domap/true/.code={\domaptrue},
map/.style={domap=#1},
map/.default=true, % for this key
domap=false, % global default
}
\newcommand{\cisset}[1]{\pgfkeys{/cis/.cd, #1}}
\newcommand{\cmd}[1][]{%
\begingroup % change the keys locally
\cisset{#1}%
\ifdomap
S1 S2 S3
\else
S0
\fi
\endgroup
}
\begin{document}
Test:
\par No map: \cmd
\par Map (locally): \cmd[map]
\par Map (locally): \cmd[map=true]
\par No map (locally, forced): \cmd[map=false]
\par No map (default): \cmd
\par Set globally to true \cisset{map} % or \cisset{map=true}
\par Map: \cmd
\par No map (locally): \cmd[map=false]
\par Set globally to false \cisset{map=false}
\par No map: \cmd
\end{document}

A very nice answer is also https://tex.stackexchange.com/a/114017/38080