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

  • Home
  • SEARCH
  • 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 8345905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:50:08+00:00 2026-06-09T06:50:08+00:00

I want to redraw an OpenLayers vector. my html button: <button id=refresh type=button>Refresh</button> and

  • 0

I want to redraw an OpenLayers vector.

my html button:

<button id="refresh" type="button">Refresh</button>

and my jquery functions to redraw the layer, the parksLayer in the refresh function is logging as false:

function refresh() {
    parksLayer.redraw(true);
}

function bind(){
    $("#refresh").bind("click", refresh);
}

and my map, I want to redraw the ParksLayer:

        map = new OpenLayers.Map({
            div: "map",
            layers: [
                new OpenLayers.Layer.OSM(),
                parksLayer
            ]
        });

UPDATE

Thanks for the help, my vector layer is defined like this:

function changeme(avalue){
        parksLayer = new OpenLayers.Layer.Vector("Parks", {
            projection: new OpenLayers.Projection("EPSG:4326"),
            strategies: [new OpenLayers.Strategy.Fixed()],
            protocol: new OpenLayers.Protocol.Script({
                url: "http://my.cartodb.com/api/v2/sql",
                params: {
        q: "SELECT * FROM activities where type_code is not null"+" "+avalue,
        format: "geojson"
    },
                format: new OpenLayers.Format.GeoJSON({
                    ignoreExtraDims: true
                }),
                callbackKey: "callback"
            }),
        });  
    }

I have a form that changes avalue dynamically which changes the GeoJSON query, so if I could redraw the parksLayer I would be left with a new selection from the layer.

  • 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-06-09T06:50:09+00:00Added an answer on June 9, 2026 at 6:50 am

    If I read the Openlayers API, redraw function does not use any parameters… You should try to call redraw() without putting “true” as a parameter…

    Openlayers API:
    redraw: function()
    Redraws the layer. Returns true if the layer was redrawn, false if not.

    Regards

    Etienne

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

TLDR : I have an Openlayers map with a layer called 'track' I want
When I want to redraw a window, is there any preferred function to call
Want to run javascript function from parent window in child window Example I have
want to know why String behaves like value type while using ==. String s1
want to have a Hyperlink-Button in a gridView in which I can display a
Want the function to sort the table by HP but if duplicate HPs then
I want to draw as well as redraw some lines from view into my
How to remove subviews from superviews and redraw on a click a button click?
I want to redraw a Graph g with only the color of a node
In my application i want to update the MapView periodically and redraw the the

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.