Here is sample code,
https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=basemap-gallery
if you move
<arcgis-basemap-gallery position="top-right"></arcgis-basemap-gallery>
outside of
</arcgis-map>
tag,
base map gallery will be disabled automatically.
see my screen.
even in js, I set
the sample works fine, is because
is inside of
When working with the map-components, if a component is not a child of a map or scene component, you can use a "reference-element" attribute to associate them.
Here is how to use reference element,
https://developers.arcgis.com/javascript/latest/programming-patterns/
warning: when you use reference element in html tag, you must use exact word "reference-element"
when you use reference element in javascript, must use exact word "referenceElement"
They are not interchangable, otherwise, will not work.
Based on this theory, I correct the online sample as following
"reference-element" is the attribute name, only to be used declaratively.
"referenceElement" is the property name, which be accessed via "element.referenceElement". It would also be used in jsx syntax for various UI libraries.
https://developers.arcgis.com/javascript/latest/programming-patterns/#attributes-and-properties
based on your advice, I test it like this, it does not work. Unless I did it not the way you means. Please use this online sample as test, explain what you exactly means, how to use reference element?
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.