Commit Graph

284 Commits

Author SHA1 Message Date
Schuyler Erle
c0fc945824 In Map.setCenter, only call Layer.moveTo if Layer.getVisibility returns true.
In Layer.setVisibility, call Layer.moveTo with zoomChanged = true, so that the
grid tiles are reloaded. In an ideal world, the grid tiles would only be loaded
if they haven't been loaded yet. This would spare us the split second wait
while the browser reloads those images from the cache, but we want to release
today, so it'll have to wait.



git-svn-id: http://svn.openlayers.org/trunk/openlayers@1448 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-14 16:16:50 +00:00
crschmidt
c5afbacc93 Add scoping term. Thanks to tschaub, closes #261 .
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1441 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-14 11:39:32 +00:00
euzuro
693eab5cc9 added getZoomForResolution() to map & layer. partial fix for #204 -- need to make a getZoomForResolution() for OpenLayers.Layer.FixedZoomLevels
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1382 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-26 10:26:12 +00:00
euzuro
f582775d11 - Removed unnecessary accessors from OpenLayers.Layer: getProjection(),
getMaxExtent(), getMaxResolution(), and getNumZoomLevels(). They were just 
   wrapping around the properties. better to just access the property directly. 
   Needed to update for these removals in many different files. 

- Improved initResolutions() functionality. It is now I believe both thorough
   and complete. The only exception is that we should maybe allow a way for 
   the user to set up resolutions[] array using only minResolution and 
   numZoomLevels instead of only maxResolution and numZoomLevels... but I'm not
   really sure anyone would ever really want to use that. And at any rate, I
   don't know the math for how to do it. I'm sure schuyler or Dr. 5 would.
   Oh. for a summary of how initResolutions works, see:
   http://trac.openlayers.org/wiki/SettingZoomLevels

- Move getResolution(), initResolutions() out of HTTPRequest and into Layer. On 
   thinking this through (and trying to write documentation), I realized that 
   the real, true, GENERIC case for a layer will be using this awesome 
   resolutions[] array that allows for setting number of zoom levels, default 
   max resolutions, special scale arrays, etc. 

- Updated code for getZoomForExtent() to work with resolutions[] array, instead 
   of using the the log 2 equation. 

- Move standard getZoomForExtent() and getExtent() out of Grid and into 
   Layer. Like above, there is no reason for these methods to be found so far
   down in the food chain. They are part of the generic calculations for 
   generic layers, so they belong in Layer. 



git-svn-id: http://svn.openlayers.org/trunk/openlayers@1379 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-26 02:51:38 +00:00
crschmidt
104e509eb9 Merge 2.0 branch to trunk.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1369 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-25 18:17:06 +00:00
euzuro
7bf1112c81 remove reproject() method which was sort of silly anyways -- i think the ve/goog marker misplacement problem was that the layercontainerdiv was not being correctly reset on a changebaselayer. so im changing the setbaselayer() to auto call setCenter() with a new zoom (by nulling the zoom beforehand and passing in the current zoom).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1259 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 21:36:23 +00:00
euzuro
4f3641606b baselayer needs to do a total redraw
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1250 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 18:13:23 +00:00
euzuro
15d3d9fc21 do not update invisible baselayers as the user navigates around. only update them when they are made visible.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1239 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 15:53:33 +00:00
euzuro
f3c12c729d remove deprecated methods for 2.0 release. Documentation available at ReleaseNotes2.0
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1228 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 02:26:12 +00:00
euzuro
3f19fdd490 fix for #168 - getScale() thanks for great patch from Tim Schaub
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1227 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 01:09:42 +00:00
crschmidt
ae02671983 Don't ever return NaN from getLayerContainerPxFromViewPortPx, since that
can cause problems in multiple different layers -- instead, just return 
null, which is handled more gracefully.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1219 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-15 16:11:58 +00:00
euzuro
c1b8c8dd60 change the '@require:' to '@requires' so as to be compatible with JSDOC standards. put these directly inside the class definition comment block. update script to suggest this and update all source files to follow pattern. Caught a missing @requires in the EventPane.js file
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1206 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-14 23:05:05 +00:00
euzuro
841fdcbfb3 split Util.js into two files. BaseTypes.js will contain all the OL Base types, such as Pixel, LonLat, Bounds, etc., as well as all the standard javascript basetypes (string, number, etc) extensions. All else remains in Util.js. In theory I have fixed all dependencies. If this doesn't work, I'll rollback.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1205 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-14 21:49:19 +00:00
euzuro
2a496c840c rename setScale() to zoomToScale() and move it down a few lines in the code
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1200 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-12 16:23:01 +00:00
crschmidt
c7e43b67f3 We removed support for this from Map unneccesarily.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1177 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 23:20:50 +00:00
Schuyler Erle
d76e18ac65 Fix the dreaded resize bug so that the map recenters automatically when relatively-sized map divs change size.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1174 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 21:17:06 +00:00
Schuyler Erle
1b26e9cb69 Differentiated the z-index base of base layers versus popups.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1173 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 20:47:07 +00:00
crschmidt
6efaf328e5 Commit scale-based methods back into trunk. Layers or Maps now support setting
a list of scales or resolutions in the options to the constructor, from which
resolutions are calculated. Map now has a 'setScale' function which will allow
you to zoom to as close to a given scale as possible.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1171 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 19:14:16 +00:00
crschmidt
e3df606001 Quote indexes into array.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1161 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 15:52:23 +00:00
Schuyler Erle
088dd71754 Moved declaration of mouseDragStart property from Map to Control.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1158 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 14:37:21 +00:00
euzuro
f339e3a93d hash -> hashtable and Hash -> Object -- let there be no confusion, we are *not* using prototype
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1144 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 04:36:39 +00:00
euzuro
f3a072b151 new layerswitcher, improved google layer, boxes layer, grid fix
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1096 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-08 18:20:24 +00:00
euzuro
620cebb79c add a 'changelayer' event that fires when a layer's visibility changes. listen for this in the layerswitcher
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1050 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-02 16:08:09 +00:00
euzuro
a171ae13b6 fixing more tabs. all tests pass
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1011 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-26 14:44:44 +00:00
euzuro
317c15a5ce readibility / coding standards
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1007 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-26 10:17:21 +00:00
euzuro
63396d27d0 r1005 introduced some infinite recursion. no good. split addControl() into two functions, one public, which adds to internal this.controls arrray... and one private addControlToMap() which does the same, but without adding it to this.controls
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1006 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-26 10:13:33 +00:00
euzuro
d079f0bbca allow user to specify initial controls via 'controls' array option, instead of simply passing an empty array and then later adding. that seems extraneous
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1005 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-26 10:01:45 +00:00
euzuro
04a2e9472d allow an option to kill all other popups on addition of new one
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1004 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-25 21:43:28 +00:00
crschmidt
5eb1fdfaca When we remove a layer from the map, if it is the base Layer, we need to find *another* base layer to replace it, otherwise when we call getExtent, etc. it will be on the *old* base layer, which no longer has a map object defined.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@999 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-24 12:17:48 +00:00
euzuro
96d0f62c59 add getLayer() function to Map
git-svn-id: http://svn.openlayers.org/trunk/openlayers@979 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-19 14:42:20 +00:00
euzuro
3f07472d5d rollback of r975
git-svn-id: http://svn.openlayers.org/trunk/openlayers@976 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-18 18:39:15 +00:00
euzuro
abeb2ce686 give the map div a reference back to the OpenLayers.Map object
git-svn-id: http://svn.openlayers.org/trunk/openlayers@975 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-18 18:13:33 +00:00
euzuro
e91d0546ee replace all usage of copyOf() with clone(). Now copyOf() is officially deprecated and unused. supported only if users out there have used it, but we can phase it out in the next official release.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@961 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-18 11:56:13 +00:00
euzuro
ec33ac4a84 give Control classes same setMap() functionality as Layer
git-svn-id: http://svn.openlayers.org/trunk/openlayers@936 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-12 00:16:14 +00:00
euzuro
3030c421b5 if we allow a non-minor setCenter to get into this loop, then even if the last setCenter() on a drag is to the same center point and zoom, the moveTo()s of the layers will still get called with non-minor parameter -- in the case of Untiled, we need this to redraw the layer on move end.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@927 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-11 01:01:23 +00:00
euzuro
5a5c0f349d somehow this got left off during the LayersReworking fiasco. Luckily only Untiled.js was actually using it. tests seem to pass, seems alright
git-svn-id: http://svn.openlayers.org/trunk/openlayers@926 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-11 00:50:32 +00:00
euzuro
b84b3763a6 remove fixed layers from the viewport, not the layercontainer
git-svn-id: http://svn.openlayers.org/trunk/openlayers@916 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-07 16:04:32 +00:00
euzuro
986eaaf7a4 add hook to trigger the drawing of a layer upon addition to the map (assuming a center has been set)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@895 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 02:20:06 +00:00
euzuro
10cbef9274 since we can technically register events for any domelement, there is no reason this variable should be named 'div'. Change it to 'element' and update its use everywhere.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@866 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 11:57:18 +00:00
euzuro
397b4cc7ba hack to catch as best as possible the resize event in both mozilla and IE. we cant catch the actual resize on the div in IE, so we do that. in mozilla the best we can do is catch the resize of the window. so that is what we do.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@860 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-03 20:08:02 +00:00
euzuro
98302beddd same-case these functions for if there is no baselayer. in theory,
these should never be called if no baselayer is set... but one never
knows what a user will do. So instead of crashing, we will just return null.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@857 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-03 14:11:48 +00:00
euzuro
43a2f03b2b the 'moveend' event was not getting properly triggered on the end of a drag... because the setCenter() was not passing a new center or zoom. move it outside the if clause and all is well.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@823 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-28 23:44:24 +00:00
crschmidt
843abf10bb Let's keep null around. At least one example (*cough* openlayers homepage *cough*) uses it, although that should obviously have been documented in a test.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@814 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-28 00:07:00 +00:00
crschmidt
239a1cefa9 Actually return the extent.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@812 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 23:49:18 +00:00
euzuro
f51e970ab1 oops. our API promises zoomToFullExtent() and getFullExtent(), so we have to deliver them. Agreed that the name change to max should stay, but for the time being, have to maintain our API. both of these functions are marked as deprecated, and a ticket is being made to eventually remove them.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@811 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 23:47:36 +00:00
euzuro
1cf12e8d34 set the options *after* the call to updateSize() has been made
git-svn-id: http://svn.openlayers.org/trunk/openlayers@809 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 23:39:19 +00:00
euzuro
563d91c4fd extra dereferencing.... copy/paste error
git-svn-id: http://svn.openlayers.org/trunk/openlayers@808 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 23:35:05 +00:00
euzuro
9b53d22a31 allow for accessing of default map values even if baseLayer has still not been set
git-svn-id: http://svn.openlayers.org/trunk/openlayers@807 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 23:31:47 +00:00
euzuro
ff0e83d0a0 bringing all changes from sandbox/euzuro/LayersReworking down into the trunk. this is a merge of r656:HEAD http://svn.openlayers.org/sandbox/euzuro/LayersReworking
git-svn-id: http://svn.openlayers.org/trunk/openlayers@806 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 23:16:26 +00:00
euzuro
f4342723e4 use bound's built in getCenter() function.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@790 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 10:47:48 +00:00