Opened 12 years ago

Closed 12 years ago

#492 closed defect (fixed)

If a point feature is set as the selection then the map zooms to the scale 1:1

Reported by: yangte Owned by: yangte
Priority: P3 Milestone: 2.3
Component: MapGuide Version: 2.0
Severity: Minor Keywords: setSelection, setExtents, 1:1
Cc: Browser: All
External ID: 1383396.01 Operating System: Windows
state: New

Description

If a point feature is set as the selection then the map zooms to a scale of 1:1. The map should not zoom so far to a point feature. It would be rarely that 1:1 is useful for a GIS user.

Steps to reproduce:

  1. Create a layer based on a point feature and add it to a map
  2. View the map in fusion web layout
  3. Use the ‘Query’ widget to find one of the features on the point layer
  4. Select one of the found features in the Results list and then click the ‘Select’ button
  5. Map is zoomed to 1:1
  6. Same thing happens when the setSelection javascript function is called.
  7. Same thing happens if a point feature is manually selected and then ‘Zoom Selection’ is used
  8. Same thing happens when choosing a result from the ‘Search’ widget

all these functions will call the js function "setExtents" in Map.js, when the parameter "oExtents" is a point which should be a rectangle, it will zoom to 1:1, to prevent this situation, I suggest to add a check like this:

if(oExtents.bottom == oExtents.top && oExtents.left == oExtents.right)
{
    this.oMapOL.panTo(new OpenLayers.LonLat(oExtents.left, oExtents.top));
}

Change History (1)

comment:1 by yangte, 12 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.