It is not illegal to have this function.
It is illegal to use speedcam files in certain countries.