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

Cesium map labels only displaying in English #11695

Closed
ghost opened this issue Dec 14, 2023 · 2 comments · Fixed by #11872
Closed

Cesium map labels only displaying in English #11695

ghost opened this issue Dec 14, 2023 · 2 comments · Fixed by #11872

Comments

@ghost
Copy link

ghost commented Dec 14, 2023

The problem

After setting up Cesium, it works perfecty, but I would like to have the maps in Spanish.
I found that I can do that with the BingMapsImageryProvider and its member culture, so I came up with this.

var imageryProvider = new Cesium.BingMapsImageryProvider({
    url: '//dev.virtualearth.net',
    culture: "es-ES",
    mapStyle: Cesium.BingMapsStyle.AERIAL_WITH_LABELS_ON_DEMAND,
});
console.log(imageryProvider);

$scope.map.scene.imageryLayers.removeAll();
$scope.map.scene.imageryLayers.addImageryProvider(imageryProvider, 0);

$scope.$apply();

As that console.log outputs, the culture is being saved correctly:

Object { _key: "my_key", _resource: {}, _mapStyle: "AerialWithLabelsOnDemand", _culture: "es-ES", etc...}

But, using one of the images as example, the petition url is still in English: url
(Manually changing them to es-ES works, that proves that the Spanish translation works)

Any help or guidance is apreciated.

@ggetz
Copy link
Contributor

ggetz commented Dec 15, 2023

Thanks @iker-molero. I can reproduce, and seems to be a bug in BingMapsImageryProvider.

@ateshuseyin
Copy link
Contributor

According to Cesium documentation (To construct a BingMapsImageryProvider, call BingMapsImageryProvider.fromUrl. Do not call the constructor directly.) I modified the code as below;

const viewer = new Cesium.Viewer("cesiumContainer");

const bing = await Cesium.BingMapsImageryProvider.fromUrl(
  "https://dev.virtualearth.net", {
    culture: "es-ES",
    key: "use-your-own-key",
    mapStyle: Cesium.BingMapsStyle.AERIAL_WITH_LABELS_ON_DEMAND,
});

viewer.scene.imageryLayers.removeAll();
viewer.scene.imageryLayers.addImageryProvider(bing);

When I evaluated the problem I saw that the problem was about metadata request and it did not tested well. I just added culture parameter into metadata request which fixes the problem.

image

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.

2 participants