summaryrefslogtreecommitdiff
path: root/src/mbgl/util/mapbox.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [core, android] Factor JSON string conversionsJohn Firebaugh2017-05-081-0/+10
| | | | | | | | | | | This adds a `convertJSON` template, to be used like: Error error optional<Foo> foo = convertJSON<Foo>(string, error); Internally, it parses the string with RapidJSON and then calls `convert<Foo>(parsed, error)`. While here, rationalize GeoJSON converters and fix error handling for Tileset conversion in OfflineDownload.
* [core] include leading slash in URL.pathKonstantin Käfer2017-01-171-5/+5
|
* [core] refactor URL parsingKonstantin Käfer2016-12-211-135/+93
|
* [build] move logging to utilKonstantin Käfer2016-11-221-1/+1
|
* [core] replace <regex> usage with plain string code to reduce binary sizeKonstantin Käfer2016-11-181-7/+14
|
* [core] Preserve non-access_token query parameters in canonicalizeTileURLSam Matthews2016-10-031-0/+11
|
* [core] Fix initialization race on util::mapbox::isMapboxURL (#6455)Thiago Marcos P. Santos2016-09-261-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | This function can be called from different threads and was depending on a global `std::string protocol` which can do heap allocations. The first thread to use it would initialized it which is not exactly safe, so this patch moves it to a `char *` that is just a pointer to the data segment, so no races. Valgrind detected it on #6431. ``` ==9874== Conditional jump or move depends on uninitialised value(s) ==9874== at 0x4C307C2: __memcmp_sse4_1 (in /home/travis/build/mapbox/mapbox-gl-native/mason_packages/linux-x86_64/valgrind/latest/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==9874== by 0x79896E: mbgl::util::mapbox::isMapboxURL(std::string const&) (in /home/travis/build/mapbox/mapbox-gl-native/build/qt-linux-x86_64/Release/mbgl-test) ==9874== by 0x6DC756: mbgl::style::TileSourceImpl::parseTileJSON(std::string const&, std::string const&, mbgl::SourceType, unsigned short) (in /home/travis/build/mapbox/mapbox-gl-native/build/qt-linux-x86_64/Release/mbgl-test) ==9874== by 0x6DDA6A: std::_Function_handler<void (mbgl::Response), mbgl::style::TileSourceImpl::loadDescription(mbgl::FileSource&)::{lambda(mbgl::Response)#1}>::_M_invoke(std::_Any_data const&, mbgl::Response&&) (in /home/travis/build/mapbox/mapbox-gl-native/build/qt-linux-x86_64/Release/mbgl-test) ==9874== by 0x50BE80: std::_Function_handler<void (), mbgl::StubFileSource::StubFileSource()::{lambda()#1}>::_M_invoke(std::_Any_data const&) (in /home/travis/build/mapbox/mapbox-gl-native/build/qt-linux-x86_64/Release/mbgl-test) ==9874== by 0x70972A5: QMetaObject::activate(QObject*, int, int, void**) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1) ==9874== by 0x70A3621: QTimer::timerEvent(QTimerEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1) ==9874== by 0x7098053: QObject::event(QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1) ==9874== by 0x60CCC8B: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.2.1) ==9874== by 0x60D1E55: QApplication::notify(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.2.1) ==9874== by 0x706FC2C: QCoreApplication::notifyInternal(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1) ==9874== by 0x70BC1AC: QTimerInfoList::activateTimers() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1) ==9874== ```
* Keep query strings in source URLs (#6182)Jake Pruitt2016-09-161-6/+24
| | | | Carries over any query strings from mapbox://-prefixed styles urls, source urls and tile urls to the api.mapbox.com requests.
* [core] [android] - public api configurable base endpoint (#6309)Tobrun2016-09-151-14/+12
| | | add runloop to test
* [core] use more const, auto and refsKonstantin Käfer2016-07-191-37/+32
|
* [core] add check for missing sprite URL file extensionKonstantin Käfer2016-07-191-0/+8
|
* mapbox: URL containing query string causes infinite loop (#5554)jingsam2016-07-041-5/+6
| | | | | | | | | | * correct all EXPECT_EQ(actual, expected) to EXPECT_EQ(expected, actual) * fix getMapboxURLPathname() of URL with querystring * add test for normalizeSourceURL of non-mapbox protocal * Update mapbox.cpp
* [Qt] Make it possible to disable libwebp and libjpeg-turbo at build timeThiago Marcos P. Santos2016-05-051-2/+2
| | | | Pull less dependencies.
* [core] Set mapbox::DEFAULT_OFFLINE_TILE_COUNT_LIMIT to 6000John Firebaugh2016-03-111-1/+1
|
* [core] Replaced raw values with util::tileSizeBruno de Oliveira Abinader2016-03-031-1/+2
|
* [core] Set initial offline tile count limit to 768John Firebaugh2016-02-241-1/+1
|
* [core] Limit total number of offline Mapbox tilesJohn Firebaugh2016-02-241-0/+2
|
* Allow using tileSize: 512 as a switch to trade retina support for 512px ↵Young Hahn2016-02-111-3/+9
| | | | raster tiles
* [core] Cache with mapbox:// tile URLsJohn Firebaugh2016-02-101-57/+30
|
* Revert "Revert WebP support due to broken builds"Bruno de Oliveira Abinader2016-01-201-0/+6
| | | | | | | This reverts commit 6709bdcacd5a45a10b554f3f225206c9494e5e43. There was an issue with the script that removes '-lwebp' from WebP linker flags, since we're statically linking. This is now fixed.
* Revert WebP support due to broken buildsJohn Firebaugh2016-01-191-6/+0
| | | | This reverts commits 2010fbb0e61cbe7c0b08560118ca887fc1d7193e, a361ce47a19d37b96b48cd605c62c5ab79bba462, and d004bb275ae3ea60bb6c2febd6fa22f1f51c3993.
* [linux] Replace PNG with WebP on tile source URLBruno de Oliveira Abinader2016-01-191-0/+6
| | | | | This is a hack, in the same fashion as adding {ratio} to the tile URLs. We should update the raster tile sources to use WebP by default.
* [core] move raster tile URL normalization to source parsingKonstantin Käfer2016-01-131-5/+1
|
* [core] unify URL prefix detection (asset:// and mapbox://)Konstantin Käfer2016-01-081-1/+1
|
* [core] Ensure URL normalization is safe. Fixes #2695Tom MacWright2015-10-281-0/+19
|
* [core] include api.mapbox.com in canonicalizationKonstantin Käfer2015-09-281-0/+51
| | | | and move the canonicalization to mapbox.cpp since it's not specific to the SQLiteCache
* Fixed missing labels and iconsLucas Wojciechowski2015-08-241-2/+11
|
* Support v8 sprite, glyph, and style mapbox:// urlsLucas Wojciechowski2015-08-211-26/+57
|
* Support new glyph URL syntaxLucas Wojciechowski2015-08-201-12/+8
|
* Add curly-braces to if-statementsjakepruitt2015-07-271-2/+5
|
* Adding special case for non-fontstack "glyph" resource URLsjakepruitt2015-07-271-1/+5
| | | | | | | - does not prepend /v4/ to api endpoints like /fonts/v1/ - only prepends it to things starting with /fontstack - solves the problem in #1918 - refs mapbox/mapbox-gl-style-spec#309
* fixes #892: support mapbox:// style URLsJustin R. Miller2015-03-301-4/+14
|
* Fix conditional in normalizeSourceURLJohn Firebaugh2015-03-061-2/+1
| | | | | | The existing conditional would always be false, since it was comparing a url that begins with "mapbox://". In fact no conditional is necessary; the secure TileJSON resource should always be requested.
* Insert {ratio} before extension, not inside access tokenMinh Nguyễn2015-03-061-2/+2
| | | | Fixes #959.
* Only add {ratio} to raster tile URLsMinh Nguyễn2015-03-061-8/+12
| | | | Thanks to @mb12 for the suggestion.
* Replace regex usage with basic string manipulationMinh Nguyễn2015-03-061-3/+17
| | | | | | Apparently we can’t rely on the existence of <regex> yet. Fixes #919.
* Load 2× raster tiles on HiDPI screensMinh Nguyễn2015-03-061-0/+9
| | | | | | Based on mapbox.normalizeTileURL() in mapbox/mapbox-gl-js, but insert a “{ratio}” placeholder instead of “@2x” in order to keep the pixelRatio logic in TileData::request(). Fixes #919.
* make most headers privateKonstantin Käfer2014-12-041-0/+44