Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6651041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:57:49+00:00 2026-05-26T00:57:49+00:00

I wanted to know where can I add visibility: false in the code below:

  • 0

I wanted to know where can I add visibility: false in the code below:
Just like in second code ?

var line_10 = new OpenLayers.Layer.GML("Line nr-10", 
    "lines/line_10.kml",
    {
        format: OpenLayers.Format.KML,
        style: {strokeWidth: 4, strokeColor: "#f08080", fillOpacity: 1 },
        projection: map.displayProjection
    }
);

Second Code:

var linja4_2 = new OpenLayers.Layer.Vector("Line nr-4 stations", {
    projection: map.displayProjection,
    strategies: [new OpenLayers.Strategy.Fixed()],
    protocol: new OpenLayers.Protocol.HTTP({
        url: "/data/linja-nr4.kml",
        format: new OpenLayers.Format.KML({
            extractStyles: true,
            extractAttributes: true
        })
    }),
    visibility: false
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:57:49+00:00Added an answer on May 26, 2026 at 12:57 am

    If I remember correctly I would put the visibility here:

    var line_10 = new OpenLayers.Layer.GML("Line nr-10", 
        "lines/line_10.kml",
        {
            format: OpenLayers.Format.KML,
            style: {strokeWidth: 4, strokeColor: "#f08080", fillOpacity: 1 },
            projection: map.displayProjection
        }, {
            visibility: false
        }
    );
    

    Or as suggested in the comments:

    var line_10 = new OpenLayers.Layer.GML("Line nr-10", 
        "lines/line_10.kml",
        {
            format: OpenLayers.Format.KML,
            style: {strokeWidth: 4, strokeColor: "#f08080", fillOpacity: 1 },
            projection: map.displayProjection
        }
    );
    line_10.setVisibility(false);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We know that we can use a concept Java Package, but I just wanted
I wanted to know whether i can direct update mysql datas to add (+)
I'm new to MVC and wanted to know how we can create controls dynamically
I wanted to know how can we get the index of the array if
Thanks for looking at this question. I wanted to know how can I use
I wanted to know if we can have a unique identifier for all objects
I wanted to know if there's a way I can bind an Asp.net Ajax
Wanted to know if someone had a suggestion on code or maybe there's a
I am currently re-building a table display page, just wanted to know if it's
New on HTML5 there's an invalid event, to which you can add a listener:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.