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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:38:25+00:00 2026-05-20T14:38:25+00:00

I have an OpenLayers map with a marker and a popup that’s supposed to

  • 0

I have an OpenLayers map with a marker and a popup that’s supposed to appear when I click on the marker. This works fine in IE8 but not in Firefox 3.6. Any ideas why? As far as I can tell the mousedown event is not getting fired since my log message doesn’t appear. The map is at http://ndinfo.heroku.com/test.html and the code I use to create the marker and popup is:

function addMarker() {
    var map = g_waze_map.map;

    var markers1 = new OpenLayers.Layer.Markers( "Markers1" );
    g_waze_map.map.addLayer(markers1);
    var size = new OpenLayers.Size(21,25);
    var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
    var icon = new OpenLayers.Icon('http://www.openlayers.org/dev/img/marker.png',size,offset);
    var marker = new OpenLayers.Marker(new OpenLayers.LonLat(34.7934759272249, 32.0835554760902),icon);

 markers1.addMarker(marker);
            marker.events.register('mousedown', marker, function(evt) {
                    console.log('hi');
                    var popup = new OpenLayers.Popup.FramedCloud(null,
                                       marker.lonlat,
                                       null,
                                       "<div style='background-color:red; width:150;height:100'>hi</div>",

 null,true,null);

                    map.addPopup(popup);

                    OpenLayers.Event.stop(evt);

                });
}
  • 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-20T14:38:25+00:00Added an answer on May 20, 2026 at 2:38 pm

    Answer from here. The key was overriding the activate() function in OpenLayers.Control.ModifyFeature. I didn’t realize having a control before creating the marker would affect the markers in any way, but it turns out that it does.

    var shapes = new OpenLayers.Layer.Vector( "Shapes" );
    map.addLayer(shapes);
    var modifyControl =  new OpenLayers.Control.ModifyFeature(shapes, {
            activate: function() {
                var activated = false;
                if(OpenLayers.Handler.prototype.activate.apply(this, arguments)) {
    
                    this.map.events.on({
                        "removelayer": this.handleMapEvents,
                        "changelayer": this.handleMapEvents,
                        scope: this
                    });
                    activated = true;
                }
                return activated;
            }
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an OpenLayers/GeoExtJS map that I have a WMSGetFeatureInfo popup come up every
I have a pretty well integrated OpenLayers map that I want to add photos
I'm trying to add a button to the OpenLayers map that is supposed to
I have a problem with the click event on an OpenLayers Map on iPhone
i'm using openlayers and geoExt. what i have is this: var options = {
I am using Openlayers to my application. i have succeeded in showing marker when
TLDR : I have an Openlayers map with a layer called 'track' I want
I have added a large image to the openlayers map I have built. The
In Javascript. I have a map of the world that is 1024 x 1024px
I have a custom toolbar that fires events on html button click, there is

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.