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
crschmidt
24eb8fe144
Implement Drag-to-Zoom for ticket #30 .
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@216 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-20 22:18:44 +00:00
crschmidt
bdc0b9eefd
Move setting of the zIndex of the control div back to map where it belongs.
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@211 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-20 11:45:25 +00:00
crschmidt
6c83a73519
Controls each create their own div, which is then individually added to the viewPortDiv directly, rather than to a Controls Div. This may fix some issues with event handling of lower layers, and may be related to #36 . It also prevents the need for the markers hack a couple commits back.
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@206 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-20 03:47:46 +00:00
crschmidt
563b828ede
Migrate Map MouseControls to MouseDefaults.js. This moves event handling into a control, where we can modify it and edit it without mucking about in the main map class, bringing this portion of the code more into line with the way other aspects of the controls situation work.
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@204 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-20 02:29:39 +00:00
crschmidt
b842c09705
Register mouseout operator on div to be same as mouseup, so we don't drag ourselves right out of the box.
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@201 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-20 01:47:15 +00:00
crschmidt
50a9f706b9
Add the ability to set the zIndex explicitly to the addLayer call, and do so in the markers.html file. This demonstrates the creation of a marker which can be clicked upon to give the url of its icon.
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@200 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-20 01:18:17 +00:00
Schuyler Erle
006053f769
Added CLASS_NAME to OpenLayers.Map.
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@170 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-18 19:36:32 +00:00
euzuro
eeba5a34c6
Changed OpenLayers.Bounds to use left, bottom, right, top INSTEAD OF minlon, minlat, maxlon, maxlat. Removed OpenLayers.Box which was not getting used. JSDOC/coding standard-ified the OpenLayers.Bounds code and wrote thorough testing for it. Should be all good.
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@140 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-18 12:48:52 +00:00
crschmidt
fb8bfed69e
element.getDimensions doesn't check styles of parent elements, so when an element is hideen because of a parent, this breaks. fall back to style.width/height in cases where we have a 0,0 size.
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@118 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-18 03:22:28 +00:00
crschmidt
aa740e8bca
fall back to Element.getDimensions when the element has no size (such as when it's hidden).
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@117 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-18 03:16:55 +00:00
crschmidt
efbd12fc29
Can't return an extent before center is set.
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@106 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-17 17:21:11 +00:00
euzuro
ff2e3017f9
Changed constructor for bounds to take minlon, minlat, maxlon, maxlat as its arguments. changed all related usage and comments
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@104 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-17 16:50:12 +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
crschmidt
8a5842a11c
Add Height/Width to control div via Map.js -- this is good for when elements inside the div are absolutely positioned, and therefore have no width.
...
The LayerSwitcher now sets right, and *unsets* left. This is important because otherwise browsers get confused.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@93 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-17 14:03:33 +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
Schuyler Erle
c494b8ef2d
Laid in some calls to various application events in Map; also, refactored zoomIn and zoomOut to use zoomTo underlyingly.
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@65 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-16 23:17:44 +00:00