No medical marijuana dispensary facility, comprehensive marijuana cultivation facility, comprehensive marijuana dispensary facility, microbusiness marijuana dispensary facility, microbusiness marijuana wholesale facility, marijuana testing facility or a comprehensive marijuana-infused product manufacturing facility shall be located within three hundred (300) feet of a then-existing elementary or secondary school, child care center, or church. "Then-existing" shall mean any school, child care center, or church with a written building permit or business license from the City to be constructed, or under construction, or completed and in use at the time the medical marijuana dispensary facility, comprehensive marijuana cultivation facility, comprehensive marijuana dispensary facility, microbusiness marijuana dispensary facility, microbusiness marijuana wholesale facility, marijuana testing facility or a comprehensive marijuana-infused product manufacturing facility first applies for either zoning or a building permit, whichever comes first. The distance shall be measured from the nearest portion of the primary structure on a lot used for an elementary or secondary school, child care center, or church to the nearest portion of any building on the lot used for a marijuana facility.