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
Schuyler Erle
ce6c4acd63
Made Events class more generic; the Events constructor now takes a list of supported application event types. Added tests for the Events class.
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@61 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-16 21:48:56 +00:00
Schuyler Erle
dc13cd1ab6
Bug fix for r[56].
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@59 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-16 21:06:07 +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
Schuyler Erle
58b202b359
Added addLayers() method to Map class; also, added tests to support it.
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@55 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-16 19:16:02 +00:00
crschmidt
46035298a5
Begin work on Google Maps Layer. In order to create this layer, layer div creation has been moved into Layer.js, and the div that is created is then slotted into the right place by the map.addLayer function. (This is so that, at layer creation time, a div is available). However, it seems like Google Maps does not know how large the div is for reasons I don't yet understand, and there'se also the fact that our zoom levels differ from Google's at the moment. But it's getting there.
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@29 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-13 16:11:52 +00:00
crschmidt
7b62f33544
More zoom level bounds checking.
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@28 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-13 15:25:28 +00:00
crschmidt
bc8197969d
Add buttons to the PanZoom control which currently allow you to zoom to any level. Add a 'zoomTo' function that
...
allows you to specify a level. This will need to be refactored: Possibly the zoom control will become part of a
subclass of PanZoom, "largePanZoom", which has a smaller set of controls.
Also add a DEFAULT_ZOOM_LEVELS setting, and an accesssor for said setting.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@23 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-13 01:29:19 +00:00
crschmidt
f2fa6622f1
Change "OpenLayers.Point" to OpenLayers.Pixel, so there's no confusion between LatLon and Point (a problem that has
...
and still does afflict the Google Maps API).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@19 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-12 22:59:47 +00:00
Schuyler Erle
c0bea6397a
Eliminate any possible circular references to controls in OpenLayers.Map.destroy().
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@17 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-12 22:38:33 +00:00
Schuyler Erle
04ba28f5a4
Revised directory structure (js/ -> lib/, test/ -> tests/) to match JSAN distribution standards, as documented at http://www.openjsan.org/documentation/dists.html .
...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@11 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-05-12 21:15:53 +00:00