A newspaper has removed an interactive online map of handgun permit holders in two New York counties that drew nationwide anger and prompted threats against its staff, the publisher said Friday.

The decision by the paper, The Journal News, to take the information off its Web site came in response to the passage of sweeping gun legislation in Albany this week, the publisher, Janet Hasson, said in a statement. “While the new law does not require us to remove the data, we believe that doing so complies with its spirit,” she said.

Legislators pushed to add the measure to the new law in response to the paper’s publication after an outcry from gun-rights advocates and some law enforcement groups.

“From the beginning it was irresponsible conduct from The Journal News,” said Roy T. Richter, the head of the Captains Endowment Association, which represents the upper echelons of the New York Police Department. He said thousands of retired officers live in the two counties — Westchester and Rockland, just north of the city — and some objected to seeing their personal information published on the newspaper’s Web site.