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 4170740
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T00:22:19+00:00 2026-05-21T00:22:19+00:00

I have the feature ID, I can grab the marker layer on GeoRSS loadend,

  • 0

I have the feature ID, I can grab the marker layer on GeoRSS loadend, but I’m still not sure how to cause the popup to appear programmatically.

I’ll create the popup on demand if that’s necessary, but it seems as though I should be able to get the id of the marker as drawn on the map and call some event on that. I’ve tried using jQuery and calling the $(marker-id).click() event on the map elements, but that doesn’t seem to be working. What am I missing?

Since I was asked for code, and since I presumed it to be boilerplate, here’s where I am so far:

map = new OpenLayers.Map('myMap'); 
map.addLayer(new OpenLayers.Layer.OSM()); 
map.addLayer(new OpenLayers.Layer.GeoRSS(name,url));

//I've done some stuff as well in re: projections and centering and 
//setting extents, but those really don't pertain to this question.

Elsewhere I’ve done a bit of jQuery templating and built me a nice list of all the points that are being shown on the map. I know how to do a callback from the layer loadend and get the layer object, I know how to retrieve my layer out of the map manually, I know how to iter over the layers collection and find my layer. So I can grab any of those details about the popup, but I still don’t know how to go about using the built-in methods of the DOM or of this API to make it as easy as element.click() which is what I would prefer to do.

  • 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-21T00:22:20+00:00Added an answer on May 21, 2026 at 12:22 am

    You don’t have to click the feature to open a popup.

    First you need a reference to the feature from the feature id. I would do that in the loadend event of the GeoRSS layer, using the markers property on the layer.

    Assuming you have a reference to your feature, I would write a method which handles the automatic popup:

    var popups = {}; // to be able to handle them later 
    
    function addPopup(feature) {
    
    var text = getHtmlContent(feature); // handle the content in a separate function.
    
    var popupId = evt.xy.x + "," + evt.xy.y; 
    var popup = popups[popupId];
    if (!popup || !popup.map) {
        popup = new OpenLayers.Popup.Anchored(
            popupId,
            feature.lonlat,
            null,
            " ",
            null,
            true,
            function(evt) {
                delete popups[this.id];
                this.hide();
                OpenLayers.Event.stop(evt);
            }
        );
        popup.autoSize = true;
        popup.useInlineStyles = false;
        popups[popupId] = popup;
        feature.layer.map.addPopup(popup, true);
    }
    popup.setContentHTML(popup.contentHTML + text);
    popup.show();
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have feature which is not correctly installed on my website. How can I
I have a feature that uses the camera so I can test it only
On many government sites in Canada, they have a feature where they can know
Can someone enlighten on why is that oracle does not support an autoincrement feature
I've read many posts and blogs at this point and I'm still not sure
I want to have stack trace not for my exceptions only but also for
If I have 200 features, and if each feature can have a value ranging
I have a feature where a user can click a video thumbnail and my
I have a simple feature: Feature: User can see the welcome page Scenario: User
I'm looking content management system that would have features similar to stackoverflow: Users can

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.