A map of marijuana dispensaries in Los Angeles released Wednesday by City Controller Ron Galperin illustrated his concern that the city will not be able to collect all of its due taxes from the shops when recreational pot becomes legal in 2018 — because so many don’t obey the law.

According to Galperin’s map, 756 dispensaries received Business Tax Registration Certificates in 2016, with not all of them paying taxes, and when stronger regulations took effect this year, just 139 obtained valid certificates in compliance with L.A.’s tax regulations.

The map also shows 563 dispensaries against which the L.A. City Attorney’s Office has filed criminal cases.

“Too many dispensaries represent themselves as being legally compliant, but we know that’s not the case,” Galperin said. “Businesses that ignore the rules and don’t pay taxes should be shut down, and people should not be buying from them.”

California voters in November approved a ballot measure legalizing recreational marijuana starting in 2018.

In preparation for the need to regulate the industry and collect taxes from it, L.A. voters in March approved Measure M, under which recreational businesses will have to pay 10 percent of gross receipts on recreational sales and up to 5 percent on medical sales, which could generate at least $50 million in new city tax revenue in 2018.

But in a letter to Mayor Eric Garcetti and the City Council, Galperin expressed concern that many dispensaries cannot be counted on to report their gross receipts accurately.

Galperin advised the city to support measures to help dispensaries gain access to federally regulated banks, and to help the city gain access to information expected to be compiled by state regulators on dispensary sales.

“When making decisions on where to buy, people should consider which businesses are complying with the law and which aren’t, and which are paying taxes and which aren’t,” Galperin said.

“We are putting information in the hands of both potential buyers and neighbors of these businesses, who deserve to know whether they are operating legally and how to report any negative impacts on neighborhoods. We need enforcement tools to ensure that these dispensaries are being responsible members of their communities,” he said.

In a letter to Garcetti and the City Council in March, a cannabis trade organization called the Southern California Coalition asked the city not to enforce its old marijuana law — Proposition D — and to quickly start implementing Measure M.

Proposition D gave limited immunity from prosecution to 135 pot shops that were open before 2007 but prohibited any new ones from opening.

The SCC wrote that should the city continue to enforce Proposition D, “We fear that our painstaking efforts to create an open and transparent process could deteriorate.”

“It would likely leave operators saddled with fears that their public participation in this process could result in their businesses being singled out or targeted, which would only force these small business owners to remain in the shadows,” the coalition wrote.