Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak Bing maps missing tile detection #1353

Closed
shunter opened this issue Dec 19, 2013 · 3 comments · Fixed by #7810
Closed

Tweak Bing maps missing tile detection #1353

shunter opened this issue Dec 19, 2013 · 3 comments · Fixed by #7810

Comments

@shunter
Copy link
Contributor

shunter commented Dec 19, 2013

From the Bing Maps team:

to solve the problem of detecting missing tiles you mention below, we do have a URL parameter you can add:

n=z

This will produce a zero-length response body for missing tiles instead of serving the no-camera image. This should be a lot easier to detect and would work in cross-domain scenarios.

@shunter
Copy link
Contributor Author

shunter commented Feb 6, 2014

I looked into this a bit. It's somewhat more complicated than I expected. The extra request parameter works fine, but the way we load images causes problems. Currently, we request a tile via XHR as a blob, then always load that blob into an image, before the discard policy is consulted. The problem is that loading the zero-length content from the blob into an image always fails, triggering the error path.

I think the Blob -> Image conversion needs to become a more real part of the load pipeline, and the discard policy interface needs to be consulted to discard the tile and stop the pipeline either based on the Blob, or based on the Image.

This would also help performance when discarding tiles, because we can skip creating an object URL for the blob, and creating and loading the actual image.

@shunter shunter removed the beginner label Feb 6, 2014
shunter added a commit that referenced this issue May 3, 2019
This removes the need to inspect pixel values to detect the placeholder "missing tile" image.

Also change `DiscardEmptyTileImagePolicy.EMPTY_IMAGE` to be a real (blank) image.
This way we always satisfy the documented API of `requestImage`.

Fixes #1353.
shunter added a commit that referenced this issue May 3, 2019
This removes the need to inspect pixel values to detect the placeholder "missing tile" image.

Also change `DiscardEmptyTileImagePolicy.EMPTY_IMAGE` to be a real (blank) image.
This way we always satisfy the documented API of `requestImage`.

Fixes #1353.
@KeyboardSounds
Copy link
Contributor

KeyboardSounds commented May 4, 2019

While this should work, I couldn't find the n=z url parameter documented anywhere here-- do we want to be using an undocumented feature of the API?

Unless there's other docs I don't know about or I'm looking in the wrong place, which could be the case.

@shunter
Copy link
Contributor Author

shunter commented May 6, 2019

The quote in this issue was from an email from a member of the Bing Maps team in regards to NORAD Tracks Santa from 2013. You're right that it's not directly documented, but the new Bing styles use it in their image URL template, and it's alluded to in the sample data for these services:

https://docs.microsoft.com/en-us/bingmaps/articles/geospatial-endpoint-service

shunter added a commit that referenced this issue May 6, 2019
This removes the need to inspect pixel values to detect the placeholder "missing tile" image.

Also change `DiscardEmptyTileImagePolicy.EMPTY_IMAGE` to be a real (blank) image.
This way we always satisfy the documented API of `requestImage`.

Fixes #1353.
njrivera pushed a commit to njrivera/cesium that referenced this issue Jul 16, 2019
* Added tests for DiscardEmptyTileImagePolicy, updated CHANGES.md

* Made comment on image blob loading error handling clearer.

* fixed linter error - 'missing use strict'

* Fix typo.

* Remove fit.

* Update CHANGES.

* update CHANGES

* eslint configuration updates and fixes

* Update Node ecmaVersion to '2019'.
* Enable [no-tabs](https://eslint.org/docs/rules/no-tabs).
* Enabled [no-restricted-globals](https://eslint.org/docs/rules/no-restricted-globals) for jasmine `fit` and `fdescribe`.
* Remove existing tabs from code-base.
* Update eslint-config-cesium CHANGES and version

Closes CesiumGS#7785

* Fix PostProcessStageTextureCache.clear, which previously didn't clear anything.

* Multisampling in sdf shader to try to get rid of artifacts

* Use DiscardEmptyTileImagePolicy for all Bing styles.

This removes the need to inspect pixel values to detect the placeholder "missing tile" image.

Also change `DiscardEmptyTileImagePolicy.EMPTY_IMAGE` to be a real (blank) image.
This way we always satisfy the documented API of `requestImage`.

Fixes CesiumGS#1353.

* Add syntax to to delete data from properties via CZML.

Specifying delete: true for any property will delete data for that property, depending on the type of property, for the specified interval (or if no interval is specified, then for all time).

This deletes samples for sampled properties, or removes intervals for interval properties.

* Much improved multisampling of the SDF text

* Fixes CesiumGS#7827

* Fix double render.

* First crack at importing AGI_articulations from glTF models.

* Some tweaking, and add option to get list of articulations.

* Add 3D Models Articulations demo.

* Fixed writeTextToCanvas to properly position the text with padding above
and below the glyph.  Previously it was doubling the padding so it was
always rendering the glyph at the very top of the canvas

* Added bitmap-sdf library

* Don't send ion access token to non-ion servers

Some ion-hosted assets can still point to additional external servers as,
part of their dataset. We were still appending the ion access_token in
the Accept header to these servers, which is at best pointless but at worst
would cause some CORS requests to fail because the Accept header was not
allowed.

* Update CHANGES

* Added SDFSettings class to hold info about how SDF fonts are generated.
Replaced tinySDF based code with a modified version of the original
cesium text rendering to preserve positioning logic.
Applying offsets in LabelCollection and Label bounding box compuation to
account for padding in the glyphs to position things correctly.
Enabled more unit tests in LabelCollectionSpec

* Fix include

* Simplified sdf shaders to push edge computation to the CPU.
Deleted tiny-sdf

* saving vertical origin in texture cache id

* Updated unit tests

* Documented totalScale in Label and using it in few places in LabelCollection

* Updated Labels SDF gallery image

* Add tests that delete data from custom properties since the code path is a bit different.

* Hook up existing CheckerboardMaterialProperty to CZML.

CheckerboardMaterialProperty was added to the entity API in CesiumGS#2385 but
was forgotten for CZML.

* Reduce Bing Maps transactions and ion Bing sessions

This is a simple PR to try and minimize the number of Bing transactions
and ion Bing sessions over the course of a page. While we can't cache
Bing metadata or ion endpoints across sessions, this type of basic caching
is allowed and should dramatically reduce use for certain use cases.

1. BingMapsImageryProvider now keeps a local cache of metadata for a given
url/style. This means destroying and recreating instances multiple times
still only uses a single transaction.

2. IonImageryProvider now caches endpoint requests. This means that
creating multiple IonImageryProviders for the same Bing asset will only
use a single Bing session.

While use cases like Sandcastle, which uses an iframe, won't benefit at
all from this change, applications that switch base layers often or
destroy/recreate the viewer as part of a SPA will see dramatic improvement.

* Initial commit of KML exporter

* Update changes.

* Removed unnecessary comments in Label.js

* Fixed background padding size computation in LabelCollection so that the
specified size in pixels is scaled properly when finally rendered

* Update the API to be based on an articulation/stage key.

* Got bilboards with styling pretty much there. Need to test (especially the hotspots)

* Remove TODO, change model center point.

* Check childTileMask if provider doesn't know tile availability.

* Update CHANGES.md.

* Tweak Sandcastle

* Fixed memory leak

* Tweaks after review.

* Fixed error in old versions of ANGLE

* Got points/billboards done.

* First cut off LineStrings with materials

* Don't rewrite Bing tile URLS.

Instead, tell Bing what protocol we want.

* MapboxStyleImageryProvider

- Rename from MapboxStyleProvider
- Modify CHANGES.md
- Add reference to ImageryProvider class

* Added support for Rectangle and Polygon graphics.

* chore(package): update merge-stream to version 2.0.0

* Add test for articulations

* Remove getter for articulationStageKeys, it's not useful by itself.

* Started adding time support

* Fixed memory leak when removing an DataSource

* Added test

* Update CHANGES.md

* Got style caching working

* Formatting

* chore(package): update gulp-zip to version 5.0.0

* Fix credits

* Ordering

* Update url parameter type

* Marked SDFSettings as private

* Added comment to bitmap-sdf explaining what it is and what it does

* Remove commented code

* Fix for request render mode

* Beginnings of test helper functions

* CHANGES.md

* Added a fallback for when GL_OES_standard_derivatives isn't available that just does a single sample with a fixed smoothing.

* Code cleanup from review.

* More testing

* fix mitering bug with ground polylines over long distances

* Add clarying doc about node transformation additive vs. replacement

* Fix

* Started work on CZML articulations demo.

* Add Sandcastle example for new Montreal Point Cloud ion asset

* Add thumbnail and improve description

* Update for 1.58

* Fix ImageBitmap spec on Edge

* 1.58.1 npm release

* use tile.data.tileBoundingRegion.minimumHeight instead of tile.data.minimumHeight

* update CHANGES.md

* Add name to contributors

* Add tests for Entity-level articulations

* CHANGES.md

* Verified all point/billboard exporting works as expected

* Fixed Tracks/Multitracks

* Add render state to copy color command. This makes viewer/scissor work for billboards in zoomed out 2D View

* Update CHANGES.md

* Make sure 204 image requests reject when using ImageBitmap

* Make ImageBitmap test only run when ImageBitmap is supported

* Update changes [ci skip]

* update changes.md

* Added tests for dynamic points. Added code for path graphics and labels. Fixed polygons. Fixed handling of default intervals

* Added a bunch of tests

* Polygon and Polyline tests work.

* Models

* Fixed typo in LineString

* Tweak CSS styling of standalone Sandcastle loader

* Gamma correct fix for polylines

* CHANGES.md

* Ground Overlay support

* Add articulation tests to CzmlDataSourceSpec.js

* Reorder code in entity layer to have consistent order of properties.

Previously the list of properties for each type of Graphics in the entity layer was different everywhere.  This made it quite difficult to compare the set of properties in the code vs the set of properties in CZML. I went through and reordered all these locations to have properties in the same order in each.

* The documentation for the constructor for each graphics type
* The content of the constructor (initializing `_property` and `_propertySubscription` to `undefined`)
* The public get/set properties
* The contents of the `clone` function for each graphics type
* The contents of the `merge` function for each graphics type
* The code assigning the values of properties in `CzmlDataSource`.

Also add some missing functionality to `CzmlDataSource`:

`box.heightReference`
`cylinder.heightReference`
`ellipsoid.heightReference`

`corridor.classificationType`
`ellipse.classificationType`
`polygon.classificationType`
`polyline.classificationType`
`rectangle.classificationType`

* Update validation document.

* Update validation document.

* Updated Corporate CLA

* Update deprecated Travis command

* support for ArcGISTiledElevationTerrainProvider

* Added ArcGISTiledElevationTerrainProvider under Additions/1.59.

* More useful error message for ImageBitmap

* Add Cesium GS to CONTRIBUTORS.md

* Solve struct ellipsoid caused the model to dark

Solved the problem that struct ellipsoid caused the model to darken on Qualcomm platform

* fix: 3dtile dark

fix: 3dtile dark

* Revert "Solve struct ellipsoid caused the model to dark"

This reverts commit d6f91aa.

* Added tests for missing coverage areas, we now return external files as a collection of blobs and we now handle inertial positions.

* eslint

* Removed debugging info from Labels SDF sandcastle demo

* Changed SDF vertex attributed to be a vec2 instead of a vec4 since the z and w components were 0

* Storing canvas width and height in local variables in LabelCollection
Storing imageIndex as a local variable to avoid redundant compuations

* Remove blank line in BillboardCollectionFS.glsl

* Added bitmap-sdf to third party section of LICENSE.md

* Renamed SDF to SDF_INDEX to match other index location naming
convention.

* Added table closing tag in Labels SDF example

* Updated doc

* Changed class to a function, updated doc and fixed tests

* Fixed example

* Update CHANGES and CONTRIBUTORS

* Oops

* Fixed issue if data uris are used for images

* Added KMZ export and a test for it.

* Updated Doc

* remove czm_ellipsoid struct

remove function czm_getWgs84EllipsoidEC
remove struct czm_ellipsoid

add Constant czm_ellipsoid_radii
add Constant czm_ellipsoid_inverseRadii

* Delete unused files

Delete unused files

* Update CONTRIBUTORS.md

* Revert "Merge pull request #1 from verybigzhouhai/3dtile-dark01"

This reverts commit f383685, reversing
changes made to b2588e4.

* Delete ellipsoidNew.glsl

* modify Constant Name

modify constant name

* Our zip library isn't thread safe. Files must be add sequentially

* Fixed factorial to actually work. It would only work if you called it in a loop in order, so I changed the test to not do that

* Update CHANGES.md

* Update CHANGES.md

* Export KML sandcastle example. Needed to add ability for modelCallback to add to externalFiles.

* Added test

* eslint

* add note and update CHANGES.md

add note and update CHANGES.md

* Update CLA instructions

* Missing info in CHANGES

* Reordered CHANGES

* Updated ion token and package.json version

* Updated Sandcastle filename with a case difference

* Replace old CLA txt with new CLA PDF

* Added link to Labels SDF sandcastle example to CHANGES.md
Added Label.totalScale property to CHANGES.md

* update export KML doc and Sandcastle

* Changed getFontInfo function to be parseFont and moved it to Label.
Rather than keeping a fontInfoCache in LabelCollection the font
properties are stored on the Label itself and the parseFont function is
called when the font string changes.

* link update

* fix

* Make PolygonGraphics.hierarchy always produce a PolygonHierarchy.

For backwards compatibility we preserve the existing behavior of allowing an array of positions to be set.
This makes the behavior more closely match the documentation. The ability to set an array of positions
was undocumented, though some Sandcastle examples do this.

This removes the need for conversion in PolygonGeometryUpdater at the point where the data is used.

* Make code more consistent between processArrayPacketData and processPositionsPacketData

* Clean up test code.

Use CzmlDataSource.load in most tests. Compare against the values from the packet data rather than copy/pasting the expected values.

* Add support for polygons with holes to CzmlDataSource.

* Add additional tests

* Add more tests. Fix incorrect behavior with reference arrays specified using intervals.

* Add more tests.

* Update validation document.

* Add more tests.

* In PolygonHierarchy, holes needs to be an array of PolygonHierarchy.

* Add holes to CZML polygon Sandcastle examples.

* fix typo

* update CHANGES

* fix typo

* update CHANGES

* Regenerate validation document and assertions.

* fix typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants