Internal link in Entities description does not work

Hi,

I have an entity and there in the description I add a link that should call up another page internally. But then I get an error and the page of the link is shown in the cesium infobox which is totally wrong.

image
image

Does anyone know how I can fix the problem immediately?
External links work by adding <a href="http://google.com" target="_blank">Google</a>, i.e. the additional attributes target="_blank".

All other target options don’t work, I’ve tried them all.

I ask for help.
Thanks in advance.

I also tried the following but didn’t work.

viewer.infoBox.frame.setAttribute(
     'sandbox',
     'allow-scripts allow-same-origin allow-top-navigation-by-user-activation'
);

You can check this post to create a custom infobox.
Another approach you can do is: You can disable default infobox by setting it’s property to false and create own div (without appending that into viewer.infobox) on triggering selectedEntityChanged event.

viewer.selectedEntityChanged.addEventListener(ent => {
  // your code here..
});

It seems like you are trying to open external page in a iframe. Try this and let me know here if it works or not.

<iframe sandbox="allow-same-origin allow-scripts allow-popups allow-forms" src="http://google.com"></iframe>

The latter didn’t work.
I even added allow-top-navigation-by-user-activation attributes to yours. But that didn’t work either.

The error keeps coming:
image

Your 1st suggestion sounds good, but how could I create such a box via with ‘div’, which also slides out from right to left as soon as you click on the entity?
Okay, the event listener code that you showed takes care of the click.

I try to go your 1st suggestion. Added an example as a link that I missed earlier…check it out and will let you know if I succeeded or not…

Thank you again for the help

Hi @Jacky,

i went your 1st suggestion and solved it perfectly and styled it well… everything works perfectly… thank you so…

But I have a question about this screenshot.
image

Here where I marked with a red arrow I copied the camera button 1:1 from the original info box.
But neither the icon is visible here, nor does the function intervene here.

Is there a way to do that too?
I would be really happy.

You can use inspect element feature of webbrowser to copy paste it’s svg:

<svg:svg class="cesium-svgPath-svg" width="32" height="32" viewBox="0 0 32 32"><path d="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z"></path></svg:svg>

OR you can download icons from Flaticon.

Yes, I copied and pasted the SVG icon in exactly the same way.
But it is not displayed there and the functionality that it zooms in place of shapes does not work either.

You should check the CSS property by inspect element in Chrome browser. There can be z-index problem either. I can’t say until I debug the program individually. I’ve given you a website link from where you can download icons.

you can add camera functionality to the icon as given in this sandcastle example.