The most thorough method to hide the ESRI logo on the map in flex)

Source: Internet
Author: User
When developing arcgisserver using Flex, an ESRI logo is added to the map by default. In general, for example, if you use your own service, you can directly add logovisible = "false" to the map attribute to hide the logo. However, if you are using an online map service or a map in a non-service mode, there is no effect. Therefore, two methods are adopted for processing. The first is force removal, and the second is to use your own logo to cover the ESRI logo and steal the day.
Method 1:
Private function Init (): void // init is the function executed after loading by default.
{
Reallyhideesrilogo (mymap );
}

Import MX. Core. uicomponent;
Import MX. Controls. image;

Private function reallyhideesrilogo (MAP: Map): void {
For (var I: Int = 0; I <map. numchildren; I ++ ){
VaR component: uicomponent = map. getchildat (I) As uicomponent;
If (component. classname = "staticlayer "){
For (var j: Int = 0; j <component. numchildren; j ++ ){
VaR stcomponent: uicomponent = component. getchildat (j) as uicomponent;
If (stcomponent. classname = "image "){
VaR IMG: Image = stcomponent as image;
If (IMG. Source. tostring (). indexof ("logo")> 0 ){
Stcomponent. Visible = false;
Return;
}
}
}
}
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.