Opened 13 years ago
Closed 13 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:
- Create a layer based on a point feature and add it to a map
- View the map in fusion web layout
- Use the ‘Query’ widget to find one of the features on the point layer
- Select one of the found features in the Results list and then click the ‘Select’ button
- Map is zoomed to 1:1
- Same thing happens when the setSelection javascript function is called.
- Same thing happens if a point feature is manually selected and then ‘Zoom Selection’ is used
- 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)); }
Note:
See TracTickets
for help on using tickets.