Apple has embarked on an ambitious program to use the sensors in its iPhones to map the large indoor areas of stores, offices, event spaces and commercial buildings, according to Onyx Beacon CEO Roman Foeckl, who attended Apple's WWDC conference for developers. (Onyx both markets beacons and provides management software for beacon owners.)

The effort isn't a secret — Apple has been seeding commercial spaces with its iBeacon technology for months.

But most people don't know that iBeacon exists, or what it is for. And Apple is using a range of technologies in addition to iBeacon to create its indoor maps. Business Insider asked Apple for comment but we didn't hear back.

Foeckl says Apple is likely now ahead of Google when it comes to indoor mapping. That is significant because indoor maps will generate revenue in the future for stores and shops in malls and arenas. It could also generate revenue for Apple.

An assortment of different iBeacons from various vendors. Wikimedia, CC Of course, there are privacy and surveillance issues that the public has not yet begun to understand or debate. It's one thing to not have privacy while walking down a street in public where anyone can see you. It's quite another to be tracked inside, behind closed doors, on private premises.

iBeacons are small devices that send a Bluetooth signal detectable by iPhones. They can be used to ping the iPhones of people walking by with offers or useful messages, such as "hey, you're walking by a Starbucks." (An example: At a recent wearables hackathon, ReadWrite editor Owen Thomas found his iPhone being pinged by iBeacons continuously.) Some iPhone users have already started to receive lockscreen notifications on their iPhones from Starbucks based on iBeacons. When a users' app detects the signal, it may send back information to the company that made the app.

The indoor map strategy is also interesting because Apple's last major mapping launch, the Apple Maps app, was a disaster. It was intended to compete against or replace Google Maps for iPhone users, but it turned out to be filled with errors and distortions, some of them hilarious — the Brooklyn Bridge imagery was so twisted it looked like it was collapsing into the East River.

Apple's disastrous Brooklyn Bridge map. Apple Apple has since fixed Apple Maps, and now it may have a jump on Google in the indoor sector.

"Apple has learned from its mistakes from the initial launch of map services and won't repeat with launch of indoor mapping," Foeckl says. "We'll have to wait for Google iO [the search giant's developer conference] to see what their next move will be for indoor maps. Apple's vision and roadmap has become more transparent after the announcement of indoor mapping."

Now, Apple needs businesses to get with the program, Foeckl says. "It will be important to see how fast venue owners adapt to the technology and add venues. Google has more venues mapped at the moment, but it looks to be easier to add venues to Apple's new indoor mapping service."

To give you an idea of just how aggressively your movements can be tracked when you have an iPhone, consider the technology being used. iBeacon, using Bluetooth, works within a few feet. You can easily imagine stores or event hosts requiring you to stop at a display or booth in order to get a code or message allowing access to further benefits, for instance. Employers could track the whereabouts of their workers down to a few inches. No more hiding in the bathroom!

Users can also be tracked indoors by wifi, GPS, and the cellular signal. Google has been creating indoor maps by triangulating wireless and GPS signals, but those maps are imprecise compared to Bluetooth signals from iBeacons. There are a dozen or more other companies like Indoor Atlas, xAd, and Euclid Analytics devoted to tracking customers inside shops via their phones.

IndoorAtlas's app at work. IndoorAtlas to figure out where people are inside a building it has no access to, by inferring the position of walls and doors based on where the humans are not.

As if to underline Apple's new interest in all things local, the company just acquired Spotsetter, a local recommendation search engine.

Apple will use a combination of technologies to build its indoor map capabilities. It is providing a CoreLocation API for app developers. (An API lets outside companies plug in their apps to Apple's iPhone operating system.) And the iPhone's M7 processor will generate data from its motion sensors.

iBeacons don't specifically create indoor maps. Rather, Apple appears to be hoping to persuade building owners to upload a map of their space, and then iBeacons could in theory be used to automatically validate the map's accuracy as iPhones receive their signals. That automation would be a huge step — currently, Google is validating its indoor maps by hand, using a human to check each uploaded map, we're told.

She won't be lost for long. Flickr user Bruce Stockwell Foeckl says privacy concerns are valid. People have not been electronically tracked indoors on a mass scale before. But iBeacon and Bluetooth are opt-in technologies. You have to choose to switch them on, and you can turn them off anytime. Apple's updated iOS 8 mobile operating system will also come with much more detailed privacy controls, in part for this reason.

If Apple wins its indoor maps race, it could gain a fortune. Google has fully capitalized on its outdoor maps, which link a phone user's location to the ads they're served both on the mobile web and in other apps. Mobile ads are a multi-billion-dollar business for Google (the company has not disclosed specifics but some estimate its mobile revenues at $9 billion in 2013).

Indoor maps could be even more lucrative, because users are just a few inches from the products being sold and the checkout where they pay for them. iBeacons will let marketers know that a shopper is in the candy aisle, looking not just at the chocolate display, but at the milk-chocolate-macadamia-nut section. It's that precise. Clearly, that would be a good time for a candymaker to reach the user with a location-aware ad in Apple's iAd system.