Commit Graph

78 Commits

Author SHA1 Message Date
Schuyler Erle
ead31f6dc6 Added license headers to all JS source files.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@657 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-21 15:22:48 +00:00
crschmidt
9b9a902ec0 Add additional fallback for Map.js if getDimensions doesn't work. I think this is essentially a 'special case' for our testing process, but it fixes it for this case.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@652 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-21 15:04:59 +00:00
euzuro
823d2ddedd add comment regarding current handling of base layers
git-svn-id: http://svn.openlayers.org/trunk/openlayers@642 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-21 11:51:59 +00:00
euzuro
76156b7317 give Map the concept of a base layer
git-svn-id: http://svn.openlayers.org/trunk/openlayers@641 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-21 11:48:27 +00:00
Schuyler Erle
b6f7222282 Bug fix to map.updateSize for IE when size is a percentage. Calls Element.getDimensions from Prototype.js, which hopefully is the right thing to do. Fixes ticket #37.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@638 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-21 02:35:04 +00:00
euzuro
91a566ca61 the last of the screen -> viewPort changes
git-svn-id: http://svn.openlayers.org/trunk/openlayers@634 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-20 23:23:31 +00:00
euzuro
33e84b6ff0 more screen->viewPort
git-svn-id: http://svn.openlayers.org/trunk/openlayers@632 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-20 23:07:30 +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
Schuyler Erle
351ebb0d52 Fix minor typo introduced in r619. Thanx, euzuro\!
git-svn-id: http://svn.openlayers.org/trunk/openlayers@620 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-20 14:57:29 +00:00
Schuyler Erle
9e8c2f3802 Augment r618 by allowing the more prosaic and self-documenting { maxResolution: 'auto' }.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@619 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-19 21:09:31 +00:00
crschmidt
00d14534d2 Set a default maxResolution. Theres' a couple reasons for this: caching of tile requests, aligning OpenLayers with Google Maps zoom levels, and saving an initial calculation that most people won't need. For the old behavior, add:
{maxResolution:null} 
to your OpenLayers.Map() call.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@618 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-19 18:29:42 +00:00
euzuro
e55d2a7cce adding ability to add a layer to the viewport instead of the layerContainerDiv - this is especially for the virtual earth implementation, as we want to simply make a div that stays put. we dont want it sliding around with the layerdiv. it should stay where it is and let its own events handler move it around
git-svn-id: http://svn.openlayers.org/trunk/openlayers@588 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-15 12:10:38 +00:00
euzuro
2d2904c6ae adding comment for dealing with popups and layers
git-svn-id: http://svn.openlayers.org/trunk/openlayers@577 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-12 16:09:02 +00:00
crschmidt
66f5e034da Never zoom more than the max. It just stays where it is.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@573 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-12 12:16:43 +00:00
crschmidt
7d0b489e42 Commit changes to include a 'minor' flag on setCenter, that indicates that a map should not call the moveend trigger.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@558 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-08 16:13:42 +00:00
euzuro
cf011820c8 when we remove popups or layers from the map, we have to set their 'map' properties back to null
git-svn-id: http://svn.openlayers.org/trunk/openlayers@545 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-07 16:22:35 +00:00
euzuro
0db22c7d88 added removeLayer() function to our map.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@536 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-07 14:54:02 +00:00
euzuro
07b621b85c coding standards.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@530 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-06 16:26:33 +00:00
euzuro
e53e339c09 make setting the map a function call. this way we can intercept and tag on event handlers.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@528 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-06 15:50:15 +00:00
euzuro
e0aa067cb6 remove 'projection' member from Layer. keep single instance in map
git-svn-id: http://svn.openlayers.org/trunk/openlayers@496 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-01 12:30:46 +00:00
crschmidt
cdd26c1df2 fix map.zoomExtent().
Re-add zoomToWorld button to PanZoom control.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@473 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-30 21:10:53 +00:00
euzuro
d6ff6c681a move controls up. now we can have 800 popups without a conflict.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@404 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-26 16:47:56 +00:00
euzuro
f115b797a3 Changed around the order of arguments for createImage, createDiv, and createAlphaImage. bubbled out helper function OpenLayers.Util.modifyDOMElement() to handle common mods. Official order now is: id, px, sz, imgURL, position, border[, overflow]
git-svn-id: http://svn.openlayers.org/trunk/openlayers@384 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-26 01:23:11 +00:00
euzuro
bf8c1fba02 give Popup an 'updatePosition()' function that allows it to re-position itself. This will be used for zoom changes.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@350 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-25 02:43:56 +00:00
euzuro
df5455e41e Since popups have a reference back to map, allow them to determine where they should be drawn internally. Thus we can remove the computing from the addPopup() function in Map.js.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@346 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-25 02:09:33 +00:00
euzuro
4dcd798e59 give popups a reference back to map
git-svn-id: http://svn.openlayers.org/trunk/openlayers@335 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-25 00:06:35 +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
crschmidt
e5bb6b7dbd Finish of r326, adding : to @require pragmas
git-svn-id: http://svn.openlayers.org/trunk/openlayers@328 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-24 17:39:21 +00:00
crschmidt
213a1b02d1 A couple changes got rolled into r326 that weren't meant to: Rolling them back out.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@327 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-24 17:38:27 +00:00
crschmidt
c0ec7f9a00 Change @require to @require:
git-svn-id: http://svn.openlayers.org/trunk/openlayers@326 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-24 17:17:22 +00:00
Schuyler Erle
cfb1b472a7 Calling map.destroy() twice previously an error in IE. Fixed.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@314 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-24 05:44:43 +00:00
Schuyler Erle
45fc70cbc7 If map.maxResolution is not set, set it to display the entire maxExtent in whatever the current map size is by default.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@301 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-23 22:41:28 +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
crschmidt
9190dd18d2 Add @require pragma to all source files.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@277 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-23 15:20:31 +00:00
crschmidt
be6ecf5dca Store div offsets in event div object, caching them until a updateSize call. This provides a significant performance gain in places where the div contains hundreds or thousands of markers, because as the div element gets bigger, determining its size through Prototype.element.page() becomes slower by a factor of up to 4 (determined through profiling with venkman).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@271 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-22 18:11:45 +00:00
Schuyler Erle
43d9a488df Cleanup the getZoomForExtent() code -- thanks to crschmidt for discovering that I had the ratio of max to current resolution flipped.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@270 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-22 17:50:51 +00:00
Schuyler Erle
7378388d45 Added a position property to Control, which allows us to specify a default
location for each Control class, and saves us from *having* to supply a pixel
position to the map.addControl() method -- the sensible default will tend to be
used instead.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@269 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-22 17:25:46 +00:00
crschmidt
b73626fbdc this.updateSize, not updateSize.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@266 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-22 16:21:42 +00:00
Schuyler Erle
0cc4aa316d Set up a resize event listener to call map.updateSize() as necessary.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@262 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-22 14:08:15 +00:00
Schuyler Erle
27c99baacb Make it possible to supply an empty list to the Map() constructor, to disable the default controls.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@261 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-22 14:06:09 +00:00
crschmidt
ea4e785409 Huge performance win in caching this. Need to document updateSize, and probably set a 'resize' handler for the document or something like that to call it automatically. Note that GMaps v1 didn't have this concept: If you resized the map, you were stuck with it. GMapsv2 exposes a function to do this, so we're in line with that expectation.
Profile difference: Before, 291 calls took 3 seconds. Now, 649 calls takes 3.49 milliseconds.
Total Time: 2859.72 (min/max/avg 0.12/35.62/9.83) vs.  Total Time: 3.49 (min/max/avg 0/1.53/0.01)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@260 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-22 13:28:37 +00:00
euzuro
08e7a5f10f update Control, Marker, and Popup such that they all have draw(px) and move(px) functions. standardization. update tests.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@255 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-22 12:50:09 +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
crschmidt
2f5f40bfe1 Move projection information storage to map. Layer/Grid.js sets the projection when it creates a tile url, and it's no longer in the default params of WMS.js.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@240 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-21 18:34:01 +00:00
euzuro
8487728e09 popup actually can use 'parentNode' to determine his parent. so no need to set anything. also, only try removing from viewPortDiv if popup.div is not null
git-svn-id: http://svn.openlayers.org/trunk/openlayers@231 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-21 17:54:23 +00:00
euzuro
359fe02bd5 popup doesnt want a reference back to the map, it wants a reference to the div that it was added to. this we will call 'parent'. with this reference, it will be able to destroy itself
git-svn-id: http://svn.openlayers.org/trunk/openlayers@229 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-21 16:59:09 +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
euzuro
7db43c23c9 since r206, controlDiv member var no longer needed
git-svn-id: http://svn.openlayers.org/trunk/openlayers@223 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-21 13:50:28 +00:00