Commit Graph

56 Commits

Author SHA1 Message Date
Tim Schaub
68472d888b Give the map a restrictedExtent property. Setting this property to some bounds causes map navigation to be limited to those bounds. Depending on the resolution settings, the viewport may still display area outside the restricted extent - though it will be centered on the restricted extent in that case. Using a combination of restrictedExtent and maxResolution, you can limit map navigation to the extent of your data (or any arbitrary extent). See the restricted-extent.html example (closes #340).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@4261 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-09-13 15:27:35 +00:00
euzuro
d6de04cddd rollback added semicolons from r4151. no ; after a regular function declaration. also some small coding standards whitespace.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@4157 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-08-31 15:15:07 +00:00
euzuro
a8d7097e67 more cleanup of tests. adding ';' to end of function definition and other minor coding style mods. tests still pass in IE6/FF.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@4153 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-08-31 12:31:43 +00:00
Tim Schaub
e4d857b167 removing HTML comment wrapping scripts - these haven't been necessary since Netscape 2.0 - if your browser doesn't run javsacript, please don't run these tests
git-svn-id: http://svn.openlayers.org/trunk/openlayers@4059 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-08-27 17:47:50 +00:00
Tim Schaub
988e3b2e9a removing unnecessary use of google layer
git-svn-id: http://svn.openlayers.org/trunk/openlayers@4055 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-08-27 16:07:01 +00:00
euzuro
8874a6069f additional patch for #742 - removeControl() now takes the control as argument, not the id
git-svn-id: http://svn.openlayers.org/trunk/openlayers@3329 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-06-14 19:18:57 +00:00
euzuro
22c8e3ded4 fix for #742 -- Adds getControl() and removeControl() methods to the map
git-svn-id: http://svn.openlayers.org/trunk/openlayers@3282 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-06-07 18:01:52 +00:00
euzuro
6da7fb6851 set correct numbers on map tests
git-svn-id: http://svn.openlayers.org/trunk/openlayers@3278 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-06-07 14:35:37 +00:00
Tim Schaub
a80d7f2826 #706 - map constructor should not add duplicate theme related link nodes to the dom - in the case where there are two maps per page, one should be customizable and the other default - this is now fixed for map + overview map or any other multiple map combo
git-svn-id: http://svn.openlayers.org/trunk/openlayers@3153 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-05-17 16:35:26 +00:00
Schuyler Erle
75b81b2374 Add 4th arg to map.setCenter() to force zoom change, and change
map.setBaseLayer() to use it on every base layer change, regardless of whether
the numeric zoom level itself actually changes. Includes test. Fixes #450.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@2952 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-04-01 20:47:52 +00:00
euzuro
3ed14463f2 second patch to fix #549. this time, instead of just clearing out everything in the div, it removes only what it added.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2858 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-03-22 19:47:48 +00:00
Tim Schaub
923a962b93 eleven new tests for default, custom, and no map theme
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2855 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-03-22 18:50:35 +00:00
euzuro
7425a06550 fix for #549 - clearing out of map div on map.destroy(). this fixes many opera tests
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2836 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-03-21 19:03:09 +00:00
crschmidt
c66f1ce360 Create a function -- OpenLayers.Util.getElement -- which replaces "$". This
should be used in all library code. This patch replaces all uses of "$()" in
existing code. The primary reason for this is to avoid conflicts with libraries
(like Prototype) which might redefine this function differently.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@2541 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-03-08 20:14:03 +00:00
Schuyler Erle
a779f0e69a Map.addLayer() will return false when adding duplicate layers. Fixes #248.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2539 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-03-08 19:58:20 +00:00
Schuyler Erle
a5483e0f6d Fix plan in the Map tests for r1639.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1643 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-06 14:35:55 +00:00
crschmidt
7e5cd23ad0 Commit changes to code for skinning, including doc/customization, which
documents the class style naming for OL, although it isn't implemented yet,
so that we have a standard to work against. Update release scripts, tests,
and create a 'theme' directory which will hold theme information as it is
developed.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1639 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-10-06 04:03:58 +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
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
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
5a68e0ffe0 stop using deprecated functions in examples and tests
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1244 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 17:11:24 +00:00
Schuyler Erle
d2f4337828 Updated tests to match recent developments.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1183 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-10 00:26:38 +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
69876208f4 fix tests that do double-test to check lonlat or xy or wh instead of using the equals() functions
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1139 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 03:56:32 +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
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
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
crschmidt
5fda900240 Commit a test for maxResolution: 'auto', maxResolution: null
git-svn-id: http://svn.openlayers.org/trunk/openlayers@824 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-28 23:49:49 +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
Schuyler Erle
c92cd6d88a Pulled down bug fixes, example updates, etc. r717:r787 from source:/branches/openlayers/1.0.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@788 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 04:40:52 +00:00
Schuyler Erle
bf6ad055df Renamed zoomExtent to zoomToFullExtent, added tests for it and for the new lonlat/px convenience functions.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@663 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-21 17:12:19 +00:00
euzuro
adf91b1d10 again, change function name from ScreenPx to ViewPortPx
git-svn-id: http://svn.openlayers.org/trunk/openlayers@631 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-20 22:57:18 +00:00
euzuro
ed3c2a6f0b change function name from ScreenPx to ViewPortPx
git-svn-id: http://svn.openlayers.org/trunk/openlayers@630 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-20 22:51:55 +00:00
euzuro
06cbeb2f11 fix for #60
conversions to/from lonlat/px need to take into account
the offset of the layersContainerDiv. 


I have introduced the following functions for converting
between layer and screen pixel values:

getLayerPxFromScreenPx() and getScreenPxFromLayerPx()

they are pretty self-explanitory.


I then renamed:

getPixelFromLonLat() and getLonLatFromPixel()

to:

getScreenPxFromLonLat() and getLonLatFroScreenmPx()

and added:

getLayerPxFromLonLat() and getLonLatFromLayerPx()


updates were made throughout the code, demos, and tests
so everything should still run smoothly.

-e-

git-svn-id: http://svn.openlayers.org/trunk/openlayers@329 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-24 18:45:50 +00:00
Schuyler Erle
0e6b61c352 All tests now pass in IE.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@315 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-24 05:46:54 +00:00
euzuro
92571569af update map.addPopup() to automatically add the popup at the correct screen location... and add it to the layersContainerDiv so that it will move with the maps. and example. and tests.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@300 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-23 21:50:24 +00:00
euzuro
2410d94107 removed px member from OpenLayers.Popup. user must now specify a px value in the draw() method, just like with markers. updated tests
git-svn-id: http://svn.openlayers.org/trunk/openlayers@252 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-22 11:45:38 +00:00
euzuro
78588aa8ea adding getPixelFromLonLat() function to Map.js -- the code is lifted from OpenLayers.Layer.Marker's drawMarker() function. also test added to ensure both translation functions return valid objects and that going back and forth is consistent. Note that i only test pixel-lonlat-pixel, because going from lonlat-pixel-lonlat there is loss due to the rounding in the lonlat-pixel phase
git-svn-id: http://svn.openlayers.org/trunk/openlayers@246 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-22 09:55:20 +00:00
euzuro
21cbfff2c7 popup no longer needs a reference to its map
git-svn-id: http://svn.openlayers.org/trunk/openlayers@230 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-21 17:53:11 +00:00
euzuro
d9762c984e add code to Map.js to allow for the addittion and removal of popups. add a new html file to play around with popups. add a test in the test_Map file for the popup adding/removing
git-svn-id: http://svn.openlayers.org/trunk/openlayers@227 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-21 15:47:10 +00:00
crschmidt
ac70551a26 Update map constructor test: we no longer have a Controls div. Also, remove duplicate test of 'ok map.layerContainerDiv is an HTMLDivElement'
git-svn-id: http://svn.openlayers.org/trunk/openlayers@207 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-20 04:17:58 +00:00
euzuro
fe360c91e5 another round of LatLon -> LonLat [99] revisions
git-svn-id: http://svn.openlayers.org/trunk/openlayers@103 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-17 16:20:12 +00:00
euzuro
6f242f5746 Replace all instances and usages of LatLon to LonLat
git-svn-id: http://svn.openlayers.org/trunk/openlayers@99 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-17 15:51:37 +00:00
Schuyler Erle
ed9b57b6df Fixed zoomend event code; changed semantics of the argument to moveToNewExtent to make the argument be the *previous* zoom level. Added tests.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@66 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-16 23:46:41 +00:00
crschmidt
0b596a94f4 Add zoomin, zoomout tests
git-svn-id: http://svn.openlayers.org/trunk/openlayers@64 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-16 22:41:36 +00:00
Schuyler Erle
8218798cf9 Added check for layer.map === map to Map tests.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@62 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-16 22:26:24 +00:00
Schuyler Erle
d4fd4f7803 Added test for Map.getResolution() bug created in r[56] and fixed in r[59].
git-svn-id: http://svn.openlayers.org/trunk/openlayers@60 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-16 21:09:39 +00:00
Schuyler Erle
143fd8d170 Map constructor now calls on div argument, so that developer doesn't need to.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@57 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-16 19:31:59 +00:00
Schuyler Erle
47bf4cdad8 Changed DEFAULT_ZOOM_LEVELS to maxZoomLevel, DEFAULT_FULL_EXTENT to maxExtent,
and RESOLUTION_AT_ZOOM_LEVEL_0 to maxResolution. These values are no longer constants,
but have (thanks to JavaScript object prototyping) sensible defaults.

These defaults can now be overridden by passing a hash as the second argument of
the Map constructor.

Added tests to verify.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@56 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-16 19:27:22 +00:00