示例#1
0
        public void Add(string mapId, CanonicalTileId tileId, byte[] data)
        {
            mapId = cleanMapId(mapId);

            lock (_lock)
            {
                if (!_mbTiles.ContainsKey(mapId))
                {
                    initializeMbTiles(mapId);
                }
            }

            MbTilesDb currentMbTiles = _mbTiles[mapId];

            if (!currentMbTiles.TileExists(tileId))
            {
                _mbTiles[mapId].AddTile(tileId, data);
            }
        }
        public void Add(string mapId, CanonicalTileId tileId, CacheItem item, bool forceInsert)
        {
            mapId = cleanMapId(mapId);

#if MAPBOX_DEBUG_CACHE
            string methodName = _className + "." + new System.Diagnostics.StackFrame().GetMethod().Name;
            UnityEngine.Debug.LogFormat("{0} {1} {2} forceInsert:{3}", methodName, mapId, tileId, forceInsert);
#endif

            lock (_lock)
            {
                if (!_mbTiles.ContainsKey(mapId))
                {
                    initializeMbTiles(mapId);
                }
            }

            MbTilesDb currentMbTiles = _mbTiles[mapId];

            if (!currentMbTiles.TileExists(tileId) || forceInsert)
            {
                _mbTiles[mapId].AddTile(tileId, item, forceInsert);
            }
        }