euzuro
46b0402b0b
oops. need to show/hide the layer when we change it.
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1609 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-05 20:11:53 +00:00
euzuro
ad545a0280
only move the visible and in range layers. the rest can redraw themselves when they come back into the picture.
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1608 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-05 20:07:42 +00:00
euzuro
2b7c6cc844
refactor range checking into map and store a state variable in layer so that we dont fire changelayer every time user zooms
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1606 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-05 19:32:07 +00:00
Schuyler Erle
fee4d6f973
Add map.getNumLayers(), map.getLayerIndex(), map.setLayerIndex(), map.raiseLayer() to support moving layers up and down in the map stack.
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1604 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-05 19:07:19 +00:00
euzuro
07ef71b7b0
Array.indexOf(), though implemented in FF, is not standard javascript. we replace it with OpenLayers.Util.indexOf(), replace all usage
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1596 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-05 16:28:24 +00:00
Schuyler Erle
d81c2f0187
Test for the presence of OpenLayers.Control before attempting to load controls. Makes it possible to run Map.js in the lightweight version.
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1595 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-05 15:55:47 +00:00
Schuyler Erle
4739147a2f
Removed modifications to Array.prototype and moved them into OL.Util instead. All tests pass.
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1590 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-05 15:18:02 +00:00
Schuyler Erle
67ced536c0
Merged r1559:r1587 from source:/sandbox/crschmidt/noprototype. OpenLayers is now Prototype-free(tm).
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1588 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-05 14:50:47 +00:00
euzuro
33c37ef78b
fix for #191 - graceful dealing with setCenter() on lonlat out of maxexteng (on first setcenter() call). added test
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1585 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-05 06:20:47 +00:00
euzuro
1414f0f656
fix for #182 and #262 -- pick the best new resolution when changing baselayers, instead of just using the same index into the resolutions array.
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1581 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-05 05:06:33 +00:00
euzuro
510ab8561c
add a new property to layer.js called 'visibility' which we now need to store instead of reading directly from the visiblity of the div itself, since the div might be hidden, but only because it is out of range. we thus add a new method on layer called inRange() which returns whether or not the layer's max/min resolution settings allow it to be displayed at the current map's resolution. to make sure that min/max resolution, scale, etc are set for *all* layers, we remove the if statement limiting the running of initResolution() to only baselayers, and we add code at the end of that function that, once the resolutions array has been calculated, then goes back and sets min/max scale and resolution. now what we have to do is every time moveTo() is called on a layer, if the zoom has changed, then we must check if the layer is inRange() and update the display accordingly. on that same note, the layerswitcher must now be attentive to these changes, so we set it to redraw every time the zoom changes. in the layerswitcher code, we now add special code to disable a layer if it is out of range. must add the superclass call to moveTo() for all of the layers to ensure this code is executed for all. update test.
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1577 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-05 04:20:16 +00:00
euzuro
0adeb2670d
changing 'minor' parameter name to 'dragging' for consistency
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1538 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-03 04:35:04 +00:00
euzuro
cab24b665d
update map's getScale() to use getScaleFromResolution()
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1536 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-03 03:45:00 +00:00
euzuro
0565566118
coding standards
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1512 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-28 06:48:27 +00:00
euzuro
3b60032995
use new functions from r1506.
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1507 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-27 20:56:42 +00:00
euzuro
2255e7d56c
update comment
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1505 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-26 23:57:35 +00:00
euzuro
e658877014
return a copy of the mapsize, not the mapsize itself. this will hopefully prevent some nasty bugs.
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1504 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-26 23:54:59 +00:00
crschmidt
003f00bc22
*Always test before committing*. One of these days, I will teach myself to
...
be a diligent committer. I promise.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1500 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-22 13:55:10 +00:00
crschmidt
dabba5ef41
We've had a number of problems related to browsers complaining on this line.
...
The popups go away, then cause:
[Exception... "Node was not found" code: "8" nsresult: "0x80530008 (NS_ERROR_DOM_NOT_FOUND_ERR)" location: "/lib/OpenLayers.js Line: 7663"]
This will hopefully silence the exception.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1499 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-22 13:51:08 +00:00
euzuro
5bd2c55610
reorder logic of test for isNaN so that if viewPortPx is null to start with we dont bomb out with error
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1495 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-20 09:51:21 +00:00
euzuro
34dfbef5a5
fix for dynamic resizing
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1487 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-19 17:08:43 +00:00
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