What could be the reason behind Cesium viewer's failure to show a model after I upload it?

My application features a 3D map of a city with an "Add building" button.

Upon clicking this button, a model of a building should be inserted into the map. However, all I see is a selection marker at the intended location without the actual building appearing.

Attempt 1

I attempted to add the building using the following code snippet (refer to file

src\main\resources\static\js\myapp.js
for the source code):

function addBuilding() {
  var position = Cesium.Cartesian3.fromDegrees(132.159633, 43.350116, 0.);
  createModel('/models/CesiumAir/Cesium_Air.gltf', position);
}

function createModel(url, position) {
    var heading = Cesium.Math.toRadians(135);
    var pitch = 0;
    var roll = 0;
    var orientation = Cesium.Transforms.headingPitchRollQuaternion(
        position, heading, pitch, roll);

    var entity = viewer.entities.add({
        name : url,
        position : position,
        orientation : orientation,
        model : {
            uri : url,
            minimumPixelSize : 128
        }
    });
    console.log("entity.model = " + entity.model);
    viewer.selectedEntity = entity;
}

Since this approach did not yield the desired outcome, I decided to explore another method.

Attempt 2

var scene = viewer.scene;
var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(
    Cesium.Cartesian3.fromDegrees(132.159633, 43.350116, 0.0));
var primitive = Cesium.Model.fromGltf({
                      url : '/models/CesiumAir/Cesium_Air.gltf',
                      modelMatrix : modelMatrix,
                      minimumPixelSize : 128,
                      appearance : new Cesium.DebugAppearance({
                          attributeName : 'normal'
                        })
                  });
scene.primitives.add(primitive);

This alternative attempt also failed to produce the expected result.

When I access the URL

http://localhost:8080/models/CesiumAir/Cesium_Air.gltf
in my browser, I can view some JSON output, ruling out any issues with broken links.

I would greatly appreciate guidance on how to modify my program to successfully add buildings. The source code and building instructions can be found here. It's possible that AngularJS used in the application might be causing conflicts with Cesium and Angular.

This informative video demonstrates the error replication process.

Update 1: Upon loading the page, I occasionally encounter the following exception (especially when uncaught exceptions are enabled):

https://i.stack.imgur.com/PYYS1.png

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

StyledTab element unable to receive To or component attributes

Is there a way to use tabs as links within a styled tab component? I've tried using the Tab component syntax with links, but it doesn't seem to work in this scenario: <Tab value="..." component={Link} to="/"> If I have ...

Creating dynamic child components in Vue.js version 2

I am currently developing a facet search system using VueJS. The concept is fairly straightforward: Within a FilterGroup component lies the overarching filter logic. This component allows for several child components, such as AttributeXYZFilter, to provid ...

Failure to display React component on screen

I have developed a React microfrontend application consisting of two sub-apps rendered through the container/ project. Both sub-apps render perfectly in isolation on localhost:8083. However, when attempting to view them via localhost:8080/dashboard, I am p ...

Copying content from one website to another using JavaScript

Currently, I am working on a website which stores data and I require assistance in transferring this data to another site. If you have any suggestions using Javascript or other methods, please let me know. ...

Is it possible to display a thumbnail image in a separate full-sized window by using CSS or JavaScript?

I am currently utilizing a program called WebWorks 2020.1 that automatically creates <img> tags from my FrameMaker source input when published to DHTML. Unfortunately, I do not have the ability to directly modify the HTML <img> or <a> tag ...

Using JQuery's .mouseover and .mouseout methods to modify font colors on a webpage

Hi there, I'm new to JQuery and trying to experiment with some basic functionalities. I have a simple navigation menu created using an unordered list, and I want to change the font color of the currently hovered list item using JQuery. However, I&apos ...

Navigating through multiple pages with React Native stack navigation

I'm currently in the process of developing a react native app and I'm facing some confusion with regards to page navigation. It appears that there is a glitch in the navigation flow, causing it to skip a page. <NavigationContainer> ...

Incorporating KafkaProducer functionality into Jersey REST Services

Hey there, I've set up a Hello World REST API sample and have crafted a basic Kafka producer code. What I'm aiming for now is to have my Kafka Producer fire off a message to a topic each time the REST API is triggered. So, whenever someone goes ...

The concealed [hidden] attribute in Angular2 triggers the display of the element after a brief delay

I am currently utilizing the [hidden] attribute within my application to conceal certain elements based on a specific condition. The situation is such that I have two divs - one for displaying results and another for showing the text "No results". Both t ...

Can you explain the differences between offsetHeight, clientHeight, and scrollHeight for me?

Have you ever wondered about the distinction between offsetHeight, clientHeight, and scrollHeight? What about offsetWidth, clientWidth, and scrollWidth? Understanding these differences is crucial for working effectively on the client side. Without this kn ...

No content in Axios response

axios.post( 'http://localhost:3001/users', { username:user.username } ).then((res)=> console.log(res.data)) Response From FrontEnd : data: &qu ...

"Running experiments with Google Ads and Google Analytics scripts results in a blank page being displayed

Currently, I am working on a plain HTML file and conducting tests to ensure that the Google Ads and Analytics scripts are functioning correctly before implementing them on other pages. A colleague who has an AdSense account provided me with the script code ...

React Material Table - issue with data filtering accuracy

Currently in my React project, I am utilizing Material Table. While everything appears to be rendering correctly, the filtering and searching functionalities are not working as expected. To provide more context, below is a sample of the code: ht ...

What could be causing my screen reader to repeat lines?

I have this HTML structure: <button ng-disabled="vm.updating" ng-click="doSomething()" class="something" type="submit" aria-label="average score"> <span ng hide="hideConditional()" class="font-white">score</span> <span ng-show= ...

Input values in Angular are not being updated according to the corresponding model values

My Angular application features two routes that share the same controller and partials. Despite the shared code, the controller and partials behave slightly differently depending on the route being used. Here are the routes: $routeProvider.when('/joi ...

Guide to simulating Twilio with Jest and TypeScript to perform unit testing

Please assist me in mocking a Twilio service that sends messages using Jest to mock the service. Below is the code I am working with: import { SQSEvent } from "aws-lambda"; import { GetSecretValueResponse } from "aws-sdk/clients/secretsmanag ...

Tips for organizing JSON information in ReactJS

Could someone lend a hand with sorting JSON data in ReactJs? I'm having trouble getting it to work properly. Also, if I want to sort by title, would it be the same process? Thanks! This is what I've tried so far: componentDidMount() { ...

Applying CSS styles to a class dynamically using JavaScript

Is there a way to dynamically add a new CSS property to an existing class using JavaScript? Let's say I have a class called .test with some pre-defined styling. How can I append the property color: blue; to this class using JavaScript? const elm ...

Testing the Confirmation Popup in Ionic Framework Using Karma for Unit Testing

I am struggling to test both outcomes of a confirmation box using karma and jasmine. Despite receiving some assistance, I am finding it challenging to mock the ionicPopup. I would like to be able to test everything from the ng-click that triggers the box ...

Clicking on the React Bootstrap Checkbox within the Nav component does not trigger a rerender of the NavItem component

Encountering an unusual issue while using a Nav and NavItem with a Checkbox from React Bootstrap. What I've noticed is that when clicking directly on the checkbox instead of the NavItem button, the checkbox does not re-render correctly even though my ...