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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:57:41+00:00 2026-05-14T04:57:41+00:00

I’ve seem to have hit a bug or i have overlooked something. I written

  • 0

I’ve seem to have hit a bug or i have overlooked something.

I written some code that enumerates through all the vector features on a OpenLayers Vector layer – to check if the mouse is inside a vector feature – if so then it displays some info based on the feature.

I had to write my own methods to do this because the existing OpenLayers Controls( select etc) stop after finding a feature under the mouse, and i the possibility of several features being stacked on top of one another.

My problem is that the .containsPoint method seems to be using coords from before a ‘pan’.
After zooming in or out the geometry seems to be in the right place and .containsPoint is works correctly when I wave the mouse over the map.

Do I need to do something after the map has been panned to update something( feature’s geometry)

  • 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-14T04:57:41+00:00Added an answer on May 14, 2026 at 4:57 am

    I realize this question has almost had it’s first birthday, and it may not be valid anymore, but I’ll give a shot at answering it anyway.

    OpenLayers.Control.DragPan makes a call to the map when you are done panning. If you check the OpenLayers.Map pan function, you will see this comment inside:

    // only call setCenter if not dragging or there has been a change
    

    The following logic in the function reflects this comment.

    So yes, every time you are done panning you need to do something like:

    dragpan.handler.up = function(evt)
    {
        dx = dragpan.handler.last.x - evt.x;
        dy = dragpan.handler.last.y - evt.y;
        var centerPx = map.getViewPortPxFromLonLat(map.getCenter());
        var newCenterPx = centerPx.add(dx, dy);
        var newCenterLonLat = map.getLonLatFromViewPortPx(newCenterPx);
        map.setCenter(map.getCenter() + dragpan.handler.xy);
    }
    

    …and things should magically work for you.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from
I am trying to loop through a bunch of documents I have to put
I have some data like this: 1 2 3 4 5 9 2 6

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.