Compare commits

..

431 Commits

Author SHA1 Message Date
crschmidt
3b9f8b0e90 Tag 2.1-rc1 release.
git-svn-id: http://svn.openlayers.org/tags/openlayers/release-2.1-rc1@1453 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-14 16:35:26 +00:00
crschmidt
130e527702 Branch for 2.1
git-svn-id: http://svn.openlayers.org/branches/openlayers/2.1@1452 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-14 16:33:48 +00:00
crschmidt
f9fdb04f8c Timeout bumped to 4 seconds instead of 2.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1451 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-14 16:31:53 +00:00
crschmidt
e295aee763 Test another way complains if there's no plan.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1450 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-14 16:31:42 +00:00
crschmidt
760e1ca014 Commit changes for tests to pass in IE.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1449 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-14 16:28:24 +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
Schuyler Erle
24381c2f37 Remove MouseDefaults.zoomBox directly, rather than attempting to remove it by DOM ID. Fixes #199 in IE.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1447 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-14 15:47:22 +00:00
Schuyler Erle
cea09f7fdb The name of the BaseLayers example should match the other examples, part 2.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1446 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-14 15:35:33 +00:00
Schuyler Erle
25b539d8bb The name of the BaseLayers example should match the other examples.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1445 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-14 15:35:25 +00:00
crschmidt
c76dc1c211 Sort resolutions from largest units/pixel to lowest units/pixel. This makes
sure that you always zoom in, rather than out :)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1443 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-14 15:03:20 +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
a210e16479 final update to r1438 -- forgot to test on ie. turns out the 'safe' part means not setting that returnValue property.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1440 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-13 08:27:24 +00:00
euzuro
9cf595df01 did not mean to commit modifications to examples in r1438. Have set them back to how they were but for one small change to the popups.html example, which I give a hyperlink inside it to show off the new functionality
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1439 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-13 08:25:40 +00:00
euzuro
7ce7f2484b update default behaviour of popups. now you can click and drag inside a popup without the events dropping through to the map, yet if you are dragging a zoombox over a popup, it still responds. this is all thanks to a new function i am adding to Util.js which is called OpenLayers.Util.safeStopPropagaition(). Turns out the default Event.stop() from prototype.js is also calling a function called preventDefault() which disallows things like selecting text or clicking a hyperlink. all tests pass.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1438 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-13 08:20:02 +00:00
euzuro
6793507a34 for case with no buffer, check lower bounds
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1437 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-13 05:28:53 +00:00
crschmidt
c8e7d93f95 Windows svn under cygwin, apparently, believes it is a unix app. But windows
*python* under cygwin believes it is a non-windows app. Altogether, we get 
a big ole mess. However, this should clear it up.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1436 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-12 23:55:28 +00:00
crschmidt
84a677f910 Let's try to fix this again... still having problems with Windows building.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1435 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-12 23:44:10 +00:00
crschmidt
9d0c94d915 Erik says that building the single file version on Windows no longer works
with the propset on these, so we'll try undoing them and see if that fixes
it.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1434 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-12 23:36:13 +00:00
crschmidt
4a65590d3e Tile opacity patch from tschaub: Fix for #235. Also includes tests to ensure
that code works.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1433 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-11 14:30:25 +00:00
crschmidt
720c8507f7 If isBaseLayer hasn't been set at all, it's undefined, not null.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1428 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-10 03:43:16 +00:00
crschmidt
28bff61128 Fix all cases where we have Windows line endings, and set eol-style="native"
on all files. Hopefully, this makes it easier for people to write patches
and do other neat things. 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1424 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-09 15:46:17 +00:00
euzuro
8305808bee only prevent event from falling through if there are actually listeners registered. this fixes #247
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1423 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-08 21:31:42 +00:00
euzuro
83f26a9336 fix bug introduced with r1421 -- mousedefaults doesnt create a div
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1422 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-08 21:31:02 +00:00
euzuro
e1878d3f65 use inheritance for draw()
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1421 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-08 20:43:12 +00:00
euzuro
244e9543cd update popup id
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1420 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-08 16:53:55 +00:00
euzuro
b157687eb2 update broken feature test-- new id
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1419 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-08 16:51:12 +00:00
euzuro
cab72e3299 oops. update test for r1417 mod
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1418 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-08 05:24:49 +00:00
euzuro
861335f356 more standardizing ids
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1417 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-08 05:23:28 +00:00
euzuro
899101ef0b step toward standardization of id policy... for popups
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1416 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-08 04:51:32 +00:00
euzuro
31692f51fe cosmetic changes -- remove spacing, add spacing. coding standards
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1415 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-07 18:37:33 +00:00
euzuro
e906982443 only set baselayer status based on transparency if *not* set in options. fix for #237 -- thanks tschaub
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1414 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-07 18:32:07 +00:00
euzuro
9b355b76dc update all base types to deal with any kind of input. a continuation of r1412 and a resolution for #245.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1413 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-07 18:18:06 +00:00
euzuro
00e354511e make sure passed in values are floats... if they are strings, parse them. just in case. add test for this
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1412 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-07 02:31:37 +00:00
euzuro
74f5b814eb update id system -- now control and layer divs take their classname and add a random number
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1411 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-06 20:44:55 +00:00
euzuro
6fd2302450 remove old unused line of code
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1410 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-06 20:25:33 +00:00
euzuro
dd3dcef4ed oops. we forgot to add the projection to the parameters. not good.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1409 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-06 05:24:07 +00:00
Schuyler Erle
e8bd5086df If Events finds a listener on a DOM element, call Event.stop so we don't fall through to other DOMelements.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1408 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-09-06 04:36:38 +00:00
euzuro
e1a1b94582 udpate id's of control divs. This is for #226
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1398 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-31 15:27:10 +00:00
euzuro
4b0d947f3e change of heart. revert r1396
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1397 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-31 14:56:29 +00:00
euzuro
51c86b7b3c create div on initialize
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1396 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-31 14:54:31 +00:00
euzuro
ae704e5158 remove superfluous example
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1395 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-31 14:53:33 +00:00
crschmidt
33499f59e9 Remove test.html. This file was originally used for debugging the new
LayerSwitcher, which turned out to be a problem with IE not understanding
'.checked' before an element is added to the DOM.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1394 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-31 10:50:34 +00:00
crschmidt
7a1ae31fc4 Fix for Ticket #201, reported by Steve Pomeroy. Thanks Steve!
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1393 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-29 11:25:54 +00:00
crschmidt
d1ac37984e Fix for #198, from Sean Gillies. Thanks, Sean!
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1392 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-29 11:19:00 +00:00
crschmidt
a2ded73387 Change GMaps key to be for OpenLayers.org.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1390 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-28 05:28:19 +00:00
crschmidt
ef00010111 Multimap now conforms to other EventPane subclasses in expected behavior for
some functions, and has tests available, so when I break it at some point, 
hopefully I'll know :)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1389 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-27 01:46:09 +00:00
crschmidt
0c1caaf717 Redo Yahoo class to work under EventPane.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1387 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-26 20:37:00 +00:00
crschmidt
8be2cfbc71 Make image load error color configurable. Document it.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1386 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-26 16:05:25 +00:00
crschmidt
ecdb77fa9c getMousePosition did not take into account page scrolling. This closes #211 .
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1385 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-26 15:55:41 +00:00
crschmidt
954d0b351a Better documentation of need to set controls: [] on constructor to turn off MouseDefaults.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1384 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-26 15:26:10 +00:00
euzuro
57161a94be part two of #204 -- all that remains is to write some test functions
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1383 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-26 10:36:18 +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
d486e1964b fix for #210
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1381 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-26 10:14:41 +00:00
euzuro
b9c6293b2c Forgot to add one comment from r1379:
- Added Layer/FixedZoomLevels.js, which is a new pseudo-layer that all layers 
   which have fixed zoom levels will need to extend. It provides alternative 
   methods to initResolutions(), getResolution(), and getExtent() which depend
   on the fixed zoomlevel layer implementing getLonLatFromViewPortPx(), 
   getViewPortPxFromLonLat() and getZoomForExtent(). For documentation of how
   this works, see the comments in the class header.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@1380 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-26 02:55:14 +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
euzuro
a8891101d6 no reason to redefine these here -- isBaseLayer is defined in OpenLayers.Layer now.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1378 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-26 00:11:01 +00:00
crschmidt
b6200568d4 IE breaks on this -- probably because document.write () delays the onload, but
appending script elements doesn't. (Hooray for IE.) rolling this back and 
reopening the ticket until I can work out the best workaround for this.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1377 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-25 18:51:01 +00:00
crschmidt
84d4e70fa5 More cleanups. These are unneccesary.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1376 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-25 18:44:23 +00:00
crschmidt
e9331479dc Right. 2.0 and trunk are not the same. svn switch is my friend.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1375 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-25 18:38:20 +00:00
crschmidt
7ed62ba639 Commit canvas work to trunk. Note that the Canvas layer is *not production
ready* -- it is a memory hog, and slow as heck when dragging. However, 
including it doesn't harm OpenLayers.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1371 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-25 18:20:20 +00:00
crschmidt
9233d5446d Merge multimap sandbox to trunk.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1370 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-25 18:18:26 +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
Schuyler Erle
282d9d6047 Added red box to drag rectangle buttons.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1345 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-23 22:06:52 +00:00
Schuyler Erle
2871b2c38c Removed apparently unnecessary call to map.event.attachToElement().
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1337 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-23 19:53:20 +00:00
crschmidt
87c30e9e4e MouseToolbar typo in docs.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1271 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-17 02:51:56 +00:00
crschmidt
c687fcaa1b Cleanup docs.sh to generate some different bits that make the refernece doc more useful.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1270 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-17 02:51:22 +00:00
crschmidt
dad6bc4c0e Slightly more readable code.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1269 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-17 02:25:41 +00:00
crschmidt
7df337279e Add BaseTypes docs.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1268 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-17 02:21:59 +00:00
crschmidt
db107fe884 Add doc generation tool (Crappy. Will be rewritten, i promise.)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1267 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-17 01:48:55 +00:00
crschmidt
2ee5996d54 Authors file updated with Tim's name.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1266 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-17 01:44:55 +00:00
crschmidt
d567b523c4 Commit documentation for remaining layers.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1265 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 23:23:19 +00:00
crschmidt
c932a87d3f Fix missed change in KaMap. Tests now all pass.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1264 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 23:00:47 +00:00
crschmidt
e955fcc6da We now have a concept of scale with the map, so we no longer need to depend on this being specific to KaMap.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1263 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 22:56:47 +00:00
euzuro
2f2dcf2f09 remove old dragging code from gmaps -- eventpane does all this for us
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1262 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 22:13:12 +00:00
crschmidt
e76f87e0df Commit Commercial layer documentation, Grid/HTTPRequest Docs, and WMS docs. Almost there.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1261 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 21:55:25 +00:00
euzuro
5c4a35b840 give BaseLayers madrid and barcelona
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1260 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 21:39:58 +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
crschmidt
1d31d524d0 Add Layer documentation.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1258 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 20:48:21 +00:00
euzuro
ef83f182ca do not mess with DEFAULT_PARAMS -- in mozilla, where the tests get called in the opposite order, this was bombing.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1257 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 20:45:57 +00:00
euzuro
31df492761 r1255 broke a test. fixed.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1256 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 19:21:21 +00:00
euzuro
748234606e it's redundant for applyDefaults() to return anything. thx tschaub
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1255 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 19:16:46 +00:00
crschmidt
65f9ae8eac Commit documentation for tile classes.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1254 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 19:15:34 +00:00
crschmidt
584bbd59a1 Document OpenLayers.Marker
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1253 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 18:44:46 +00:00
crschmidt
d7b1483089 Document OpenLayers.Icon.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1252 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 18:44:28 +00:00
euzuro
0f9a02bf61 no longer need to worry about grid moving around when it's invisible.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1251 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 18:14:10 +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
crschmidt
bd25727b27 Document AJAX helper functionality.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1249 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 17:41:54 +00:00
euzuro
f98ac685d1 kill the double-click event after we have dealt with it
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1248 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 17:34:39 +00:00
crschmidt
7da2079736 Documentation for Control classes.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1247 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 17:28:52 +00:00
euzuro
c2355d207c make sure scroll only scrolls if it was done over the map, and also stop event propagation so that the window doesnt scroll too
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1246 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 17:24:55 +00:00
crschmidt
2e3ff459b2 Change Scale control to use getScale() from map.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1245 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 17:19:28 +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
euzuro
c5223b4579 make marker fall *exactly* on barcelona. set the icon up with calculateOffset() function so it looks right
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1243 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 17:09:14 +00:00
euzuro
0637223342 make ve take up whole screen width
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1242 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 17:08:11 +00:00
euzuro
f5ee80907c use default wheel functions that i created earlier
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1241 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 16:53:41 +00:00
euzuro
f24f01a1cc add an example with wms, google, and ve layers all together
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1240 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 16:07:31 +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
crschmidt
d828dd8f81 Enable Spiral Tile Loading In KaMap.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1237 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 15:34:59 +00:00
euzuro
6735fb0b2a make google example bigger and reinstate ability to add a marker
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1236 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 15:05:04 +00:00
euzuro
1393fb43f8 put @requires statements inside JSDOC comment block
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1235 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 14:50:34 +00:00
crschmidt
2376bfe291 This is only neccesary because of the naming scheme, not because it actually
needs any functionality from WMS.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1234 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 13:30:10 +00:00
crschmidt
07751a7206 Fix @require: to @requires
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1233 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 13:27:56 +00:00
crschmidt
6e14190463 Remove broken requires statement.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1232 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 13:22:55 +00:00
euzuro
7e312bf596 if zoom hasnt changed, use PanToLatLong() instead of setCenter()
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1231 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 05:59:37 +00:00
euzuro
208957ade6 there has never been a VELatLongBounds... at least not that we know of. this code was just brought over from google.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1230 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 05:49:07 +00:00
euzuro
c7cb7744e7 if we are going subclass from EventPane, then there is no need to bother with catching VE events...
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1229 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 05:48:09 +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
euzuro
1baadf57ac make the same change as in r1209 to wms-untiled. make baselayeredness based on transparency (as it was before)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1226 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 01:04:07 +00:00
euzuro
f904f2ed15 add an informational comment and do a little coding standards cleanup. no functional change here
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1225 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-16 00:33:25 +00:00
crschmidt
930055ac19 With the IE fix, Untiled WMS is no longer a lost cause. bring it into the
single file build.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1224 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-15 21:14:24 +00:00
crschmidt
44b695666f Document OpenLayers.Map class.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1223 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-15 20:02:10 +00:00
crschmidt
f56824a778 Add support for Google Layer to MVS.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1222 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-15 18:07:43 +00:00
crschmidt
8255997bc7 Add a key for localhost, for those of us developing on a localhost setup, so
that it can just be grabbed from here.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1221 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-15 18:05:28 +00:00
crschmidt
cbd921f643 Add the ability to add a 'marker=true' option to URL queries, so that you
can have a marker at your center point, a la gmaps.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1220 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-15 17:48:07 +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
crschmidt
cbde344ad0 Add non-stringified condition, courtesy of tschaub pointing out the error
of my ways :)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1218 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-15 15:38:26 +00:00
crschmidt
4b7b1cb700 Untiled WMS defaults to not having a base layer, which doesn't work so much
with the whole 'only layer in the example' thing. (Working on fixing #137 .)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1217 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-15 14:22:31 +00:00
crschmidt
d11ddfbb87 Change OpenLayers.ProxyHost in Subversion to be null. This means that Ajax
requests will 'just work' if the file is loaded locally (which was only the
case before when using relative URLs). It also means that the examples better
document how to set ProxyHost, since they no longer depend on an undocumented
setting.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1216 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-15 14:11:58 +00:00
euzuro
3faa7460ff scrolling with mousewheel triggers zooming.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1215 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-15 12:50:42 +00:00
euzuro
8ab6715f83 fix more tabs
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1214 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-15 12:46:45 +00:00
euzuro
dccfe5c4aa add all three variations of google layer to example
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1213 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-15 12:46:20 +00:00
euzuro
512465037b fix tabs
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1212 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-15 12:43:50 +00:00
euzuro
634eb0afc8 small updates to Google layer and EventPane -- Google needs to @requires EventPane and not Layer, some minor stylistic changes to EventPane, updating tests so they will pass.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1211 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-15 12:25:39 +00:00
euzuro
4d59db6648 extra comma bombs IE
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1210 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-15 12:17:04 +00:00
euzuro
dd07041019 make transparent wms layers be overlays again. fix test.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1209 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-15 12:09:46 +00:00
crschmidt
9984c776de Since VirtualEarth doesn't understand bounds at all, this function didn't work.
This is not an ideal situation, becauuse it's not really 100% correct for a 
mercator projection, but it does cause things to work.

It seems that for some reason, the EventPane isn't actually catching all the 
move events -- this seems to be what is causing the slow dragging. I'm not 
sure of the reason for this, but maybe Erik or someone else will be able to 
offer hints. I could also just be wrong ;) I just know it's slow, really.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1208 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-15 02:15:03 +00:00
Schuyler Erle
846a11a004 altered VirtualEarth to subclass EventPane.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1207 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-15 01:48:55 +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
2597f97165 cleaning up examples a little bit
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1204 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-14 21:17:36 +00:00
euzuro
b6a8ead478 useless comment
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1202 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-12 17:40:37 +00:00
euzuro
b63427037f coding standards
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1201 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-12 16:24:33 +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
euzuro
0f9065cd11 clean up code a wee lite bit in the initGrid() function... then remove the draw() call and change the moveTo() call to not trigger a redraw() on the tile. This way the initTiles() goes through and configures the tiles with everything they need... but without actually redrawing them. Then we add the spiralTileLoad() function which will go through and actually trigger the redraw on the tiles, but in that spiraling outwards way
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1199 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-12 15:58:25 +00:00
euzuro
96c56e9d84 added 'drawn' property to all tiles. removed redraw() and adapted all draw()s to auto handle redraw. remove getPosition() accessor that noone was using. set generic Tile's moveTo() to auto trigger the clear() and the redraw() (if desired). Update Image and WFS tile classes correspondingly. also update tests
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1198 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-12 15:54:51 +00:00
euzuro
0a04ee3d1b remove extraneous setVisibility calls... with new baselayers stuff they are auto set to invisible
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1197 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-12 15:41:15 +00:00
euzuro
1454e3df90 fix test to access position directly -- so we can eliminate the extraneous getPosition() handler
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1196 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-12 15:35:52 +00:00
Schuyler Erle
8f33a633aa Fixed Layer.Google to subclass Layer.EventPane. Still need to fix z-index of copyright divs.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1195 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-11 18:03:50 +00:00
Schuyler Erle
3b134deace Tests for EventPane class. 1 test still fails. (the one that actually tests the event passage.)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1194 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-11 18:01:22 +00:00
Schuyler Erle
b6d91edda4 EventPane now works -- puts a transparent pane over a layer and passes events through it down to the map.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1193 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-11 18:00:07 +00:00
Schuyler Erle
1726680b10 Separated out attachToElement() so that a single Events object can capture browser events from more than one object. Intended for use by Layer.EventPane.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1192 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-11 17:57:41 +00:00
Schuyler Erle
45bea9f9f4 Fix in Layer.setName for test failure caused by r1188.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1191 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-10 21:41:13 +00:00
euzuro
16a0ecf41a rewrite but this time not killing array structure by setting to a new var
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1189 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-10 06:36:14 +00:00
euzuro
a6af08b092 fix for #120
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1188 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-10 06:08:34 +00:00
euzuro
76f38a5a36 fix for #136
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1187 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-10 06:02:14 +00:00
euzuro
375d968278 suggestion from #138
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1186 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-10 05:59:17 +00:00
euzuro
ef4c2b07e5 no use to set vis false
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1185 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-10 01:07:41 +00:00
euzuro
94e823defc copied from openlayers.org homepage
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1184 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-10 00:50:21 +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
Schuyler Erle
02e8c1ba00 Fix kaMap test to account for tile buffering.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1182 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 23:44:59 +00:00
Schuyler Erle
a2002868f1 Fix embarassing typo, part II.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1181 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 23:41:52 +00:00
Schuyler Erle
2d35451a2e Fix embarassing typo.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1180 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 23:40:38 +00:00
Schuyler Erle
206e97ad0d Check to see if values are NaN in *.equals().
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1179 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 23:39:47 +00:00
Schuyler Erle
0b41ad2cef Check to see if values are NaN in *.equals().
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1178 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 23:38:48 +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
euzuro
bf41b45532 i broked ie. der problem is dat extra comma. ok for ffox but not for ie.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1176 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 22:20:50 +00:00
Schuyler Erle
b3ab32950d Added Layer.EventPane stub that subclasses Layer, as a possible superclass for Layer.Google/VE/etc. Doesn't do anything special yet.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1175 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 22:09:15 +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
euzuro
b2ab65df12 fixing bug introduced with r1134
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1172 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 20:10:10 +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
a6edeb64b5 Added normalizeScale and getResolutionFromScale to Util.js.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1160 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 14:55:32 +00:00
Schuyler Erle
3f5c2a8fb9 Moved INCHES_PER_UNIT and DOTS_PER_INCH into Util.js.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1159 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 14:47:26 +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
crschmidt
fb3ff32919 Grid.js no longer uses the 'newGrid' variable.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1157 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 13:39:10 +00:00
crschmidt
7a3f9b8444 KaMap uses a different initTiles because it doesn't use the same starting
point for '0,0'. This meant that with the new initTiles change, we were
not adding enough buffer tiles around the kamap layers, so they would
display funkily. This fixes that issue.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1156 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 13:38:59 +00:00
euzuro
2991ae3191 implement clear() in Image
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1155 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 06:25:54 +00:00
euzuro
5d64ebdf94 updates so WFS *should* work with new tiling algorithm
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1154 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 06:24:28 +00:00
euzuro
bc6b2e690d copy/paste bug
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1153 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 06:20:51 +00:00
euzuro
3d13e1f60d coding standards
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1152 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 06:20:01 +00:00
euzuro
960a70ec07 use new clearGrid()
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1151 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 06:15:32 +00:00
euzuro
3b929fd7a2 clean up clearGrid()
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1150 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 06:14:05 +00:00
euzuro
b3c10c0892 remove unused remove function, add new clear() function
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1149 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 06:11:31 +00:00
euzuro
8e5acd019a declare urls property in wfs tile
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1148 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 05:58:37 +00:00
euzuro
f3d6fb8718 add JSDOC commenting and stub moveTo function in WFS tile
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1147 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 05:42:42 +00:00
euzuro
b262f2fb71 hack hack hack
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1146 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 04:41:21 +00:00
euzuro
3a9d4e8852 we have no logger now and i doubt we ever will
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1145 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 04:39:33 +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
f65ea55fa3 str -> String
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1143 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 04:23:27 +00:00
euzuro
0332bd09ec event -> Event
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1142 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 04:21:29 +00:00
crschmidt
bc780edcec Fix test failures by changing the failover mode to check for existince of needed variables rather than storing 'newGrid'
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1141 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 04:18:18 +00:00
euzuro
c0e06dae19 grid is always loaded. check only if we have a map
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1140 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 03:59:06 +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
crschmidt
31af99c64d Fix new test failures with the tile-reuse branch
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1138 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 03:54:10 +00:00
crschmidt
0ba7961df4 Commit tile-reuse branch back to trunk. This branch offers numerous performance
improvements in the form of reduced memory use and lower element creating costs,
hopefully making the OpenLayers code more usable in internet explorer as well
as less of a memory hog in Firefox and other browsers. Additionally, a buffer
is available around the main map grid which allows tiles to be loaded outside
of the viewing area for faster dragging.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1137 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 03:47:33 +00:00
euzuro
51ac2b4acf remove useless or duplicate functions from Util.js -- no more: Array prepend() append() -- use push() and unshift(). clear() and indexOf() both removed as they are duplicated in Prototype.js -- all instances replaced and tests updated.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1136 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 03:31:06 +00:00
euzuro
f2a3cf9348 don't allow a baselayer to unselect itself
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1134 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-09 03:10:57 +00:00
euzuro
864e54b8e7 if there are no overlays then don't display the overlay label
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1116 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-08 22:02:28 +00:00
crschmidt
9ebdfabd30 Change this to use dev version as is practice for examples.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1098 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-08 18:37:40 +00:00
crschmidt
7cbb36a5ea Commit XHTML example page.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1097 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-08 18:33:34 +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
crschmidt
138d22af3f Commit with no zoom passed.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1084 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-08 15:34:59 +00:00
crschmidt
e60734747d Commit example for testing of bug reports on mailing list. Will deliver this
URL to users and see if they can reproduce the problem in a simple test case
that mimicks this.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1083 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-08 14:21:10 +00:00
crschmidt
adc561b38f When panning by large distances, OpenLayers previously created all the grid
space inbetween. This no longer happens -- instead, the grid will re-init if 
the bounds is not at least partially contained by the existing box.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1074 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-03 17:27:47 +00:00
euzuro
236b39138d add new layerswitcher icons
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1068 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-03 11:57:11 +00:00
euzuro
29aec75256 update wiki link
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1052 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-02 18:11:55 +00:00
euzuro
94072f8dfe update wiki link
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1051 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-02 18:11:11 +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
443f28dee8 change warning background color to darkblue. lets try to be consistent here
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1049 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-31 18:35:22 +00:00
crschmidt
0343f5a35e The old Marker wasn't displaying in the right position when you zoomed out -- no Icon.Offset was being set. (The code was copy pasted from before such a thing existed.) Change to the OpenLayers marker style, instead of some random image I grabbed off a website -- using the default icon means our offset is set right, so the markers end up in the right place.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1038 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-29 12:28:20 +00:00
euzuro
6d330f1f05 no reason to exclude VE. it is mostly done
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1015 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-27 00:55:30 +00:00
euzuro
a559e87775 decomposed in r989 but forgot to put the link.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1014 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-26 21:14:39 +00:00
euzuro
6c22690d8b removing JSON handling code from Ajax.js. It is not currently needed in this library.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1013 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-26 15:52:33 +00:00
euzuro
88e1b772b9 only call the concluding setCenter() (which generally will do no more than fire the 'moveend' event) if the drag was actually performed. otherwise, it was just a click, and no need.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1012 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-26 15:33:12 +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
3962b0a814 fixed tabs, multiple return (coding standards)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1010 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-26 14:42:50 +00:00
euzuro
5216e5b042 add comment -- limitSigDig only works with integers... for now
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1009 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-26 12:27:41 +00:00
euzuro
ce69912782 add limitSigDigs() function to number's prototype. tests included
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1008 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-26 12:22:12 +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
euzuro
65da9e491e '=' != '==' oops.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1003 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-25 21:40:02 +00:00
crschmidt
d221e33ba6 More documentation, link to wiki.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1002 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-24 12:37:23 +00:00
crschmidt
d87312cb49 Add ka-map example file. This is a PHP file, slightly modified from the distribution, and combining the tile.php and config.php files into one, so that users only have to use one file to set up a ka-map backend.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1001 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-24 12:33:51 +00:00
crschmidt
975377fb89 KaMap tests. This led to r999, relating to base layer differences, and is in large part a copy of the Grid layer, so it could use some more tests to ensure it Does The Right thing with regard to the different initTiles functionality that kamap requires.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1000 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-24 12:18:51 +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
crschmidt
2afe7dbab4 Set OpenLayers.ProxyHost on examples that make use of loadURL.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@998 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-24 11:38:48 +00:00
crschmidt
162f0a408b Add require statements to feature classes, so that single file build works correctly.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@997 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-24 11:30:50 +00:00
crschmidt
b5fb825788 Change freemap mapfile.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@996 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-24 11:29:46 +00:00
euzuro
b063447471 move getFeature() to the Layer
git-svn-id: http://svn.openlayers.org/trunk/openlayers@995 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-21 19:19:54 +00:00
euzuro
82d335df03 add a getFeature() to Tile.WFS
git-svn-id: http://svn.openlayers.org/trunk/openlayers@994 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-21 19:07:33 +00:00
euzuro
96c3720aab protect for null bounds (not-loaded map)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@993 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-21 18:22:37 +00:00
crschmidt
02efb5c213 Edit out toJSON() prototypes since they're breaking unit tests.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@991 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-21 03:40:31 +00:00
euzuro
4f208e2207 now with multiple wfs servers, we do NOT want to clear this list. argh.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@990 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-20 18:01:37 +00:00
euzuro
3351e2ceb1 decompose addResults() function
git-svn-id: http://svn.openlayers.org/trunk/openlayers@989 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-20 16:41:38 +00:00
euzuro
339026faf6 update tests to new feature id
git-svn-id: http://svn.openlayers.org/trunk/openlayers@988 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-20 16:10:25 +00:00
euzuro
16b0f1b3ef always give features random id's. this prevents duplicate issues on zooming
git-svn-id: http://svn.openlayers.org/trunk/openlayers@987 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-20 16:00:43 +00:00
crschmidt
e75ece7909 Add JSON parser and exporter, to allow people to more safely parse and use JSON in their OpenLayers applications.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@986 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-20 14:23:05 +00:00
euzuro
9783a64c64 update comment
git-svn-id: http://svn.openlayers.org/trunk/openlayers@985 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-20 13:47:55 +00:00
euzuro
b6e937e877 add addScript() function for loading JSON scripts (or any scripts, for that matter)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@984 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-20 13:46:33 +00:00
euzuro
9a5f6c8d33 start tile & layer id's with standard strings, to avoid funky characters when later these ids are used as parameters
git-svn-id: http://svn.openlayers.org/trunk/openlayers@983 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-19 17:09:18 +00:00
euzuro
ca8993dd68 only send up arguments if not blank
git-svn-id: http://svn.openlayers.org/trunk/openlayers@982 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-19 16:41:36 +00:00
euzuro
2e67a6aedf add getTile() function to Grid.js. with tests
git-svn-id: http://svn.openlayers.org/trunk/openlayers@981 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-19 15:20:25 +00:00
euzuro
2def6f6327 give Tile a unique id. add tests
git-svn-id: http://svn.openlayers.org/trunk/openlayers@980 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-19 14:47:41 +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
euzuro
5855e1cb1f move clear button down with the run buttons.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@978 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-19 14:41:18 +00:00
euzuro
f71f3d0cfb give layer a unique id. udpate tests
git-svn-id: http://svn.openlayers.org/trunk/openlayers@977 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-19 14:30:46 +00:00
euzuro
3f07472d5d rollback of r975
git-svn-id: http://svn.openlayers.org/trunk/openlayers@976 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-18 18:39:15 +00:00
euzuro
abeb2ce686 give the map div a reference back to the OpenLayers.Map object
git-svn-id: http://svn.openlayers.org/trunk/openlayers@975 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-18 18:13:33 +00:00
euzuro
4709d697b7 add appropriate requirements now that we are using an Util.js function in Feature.js
git-svn-id: http://svn.openlayers.org/trunk/openlayers@974 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-18 17:21:36 +00:00
euzuro
e08ab3371c use built-in VE translation functions
git-svn-id: http://svn.openlayers.org/trunk/openlayers@973 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-18 16:43:34 +00:00
euzuro
a046bb2b31 bug hidden from change to multiple WFS
git-svn-id: http://svn.openlayers.org/trunk/openlayers@972 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-18 16:31:39 +00:00
euzuro
c0e82d966f consolodate usage of Math.random() in OpenLayers.Util.createUniqueID()
git-svn-id: http://svn.openlayers.org/trunk/openlayers@971 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-18 16:23:12 +00:00
euzuro
ab98af7635 add test for OpenLayers.Util.createUniqueID()
git-svn-id: http://svn.openlayers.org/trunk/openlayers@970 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-18 16:17:01 +00:00
euzuro
0a1529e00a lowercase functionname, indicate unique
git-svn-id: http://svn.openlayers.org/trunk/openlayers@969 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-18 16:12:31 +00:00
euzuro
788ee7fee2 add a util function to create a random id
git-svn-id: http://svn.openlayers.org/trunk/openlayers@968 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-18 16:10:38 +00:00
euzuro
1a71ac6199 update to new way of specifying feature class. OpenLayers.Feature.WFS is actually the default, so this technically doesnt even need to be done, but just for example.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@967 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-18 15:46:38 +00:00
crschmidt
692d0f6113 Fix broken units: inches was missing, and dd was in place of images.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@966 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-18 14:37:40 +00:00
crschmidt
f873f81545 Scale control file was not included via the non-single file version.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@965 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-18 14:32:53 +00:00
euzuro
3c4d324f12 allow for user to specify an alternate tile class to use with WFS
git-svn-id: http://svn.openlayers.org/trunk/openlayers@964 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-18 14:19:12 +00:00
euzuro
17426fcfc4 no longer need to set this parameter here now that we are correctly bubbling the setMap() call up to its two superclasses. Before, when we didnt define setMap() in WFS.js, then it was only bubbling up to Markers.js, which means that it wasnt getting the default tileSize from the map which happens in Grid.js.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@963 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-18 14:07:32 +00:00
euzuro
7651590f7d make sure setMap() bubbles up correctly to both superclasses
git-svn-id: http://svn.openlayers.org/trunk/openlayers@962 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-18 13:37:04 +00:00
euzuro
e91d0546ee replace all usage of copyOf() with clone(). Now copyOf() is officially deprecated and unused. supported only if users out there have used it, but we can phase it out in the next official release.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@961 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-18 11:56:13 +00:00
euzuro
fc41d9dac1 update projection processing. if a layer (or the map) declares its projection as 'none' then no SRS parameter is added to the WMS/WFS requests
git-svn-id: http://svn.openlayers.org/trunk/openlayers@960 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-17 15:39:44 +00:00
euzuro
f9034ac9a2 do not add null-valued parameters
git-svn-id: http://svn.openlayers.org/trunk/openlayers@959 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-17 15:37:48 +00:00
euzuro
fa090a0826 clear the grid if not visible
git-svn-id: http://svn.openlayers.org/trunk/openlayers@958 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-17 13:09:39 +00:00
euzuro
7994088a7a update WFS to new clone()
git-svn-id: http://svn.openlayers.org/trunk/openlayers@957 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-17 12:59:12 +00:00
euzuro
0bcf214ddc update ve.html example
git-svn-id: http://svn.openlayers.org/trunk/openlayers@956 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-16 18:57:35 +00:00
euzuro
fca63a4ffe two changes I had to scour the net to find. First off, PixelToLatLong() does not take the arguments that the official SDK tell us it does. Thanks to Denis of ViaVirtualEarth.com for the workaround. Next, the olPix-vePix conversion, the actual mysterious undocumented 'Pixel' class appears to be Msn.VE.Pixel -- thanks to blogs.msdn.com/virtualearth for that one. if only things were a little more *open* we wouldnt have to hunt for things like this <exclamation>.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@955 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-16 18:49:39 +00:00
euzuro
500cc01778 rearrange loading structure to account for ve libraries not being loaded and for the mozilla match bug
git-svn-id: http://svn.openlayers.org/trunk/openlayers@954 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-16 18:18:29 +00:00
euzuro
63b8cd6210 ve still doesnt totally work, but soon it will... and at any case it no longer auto-includes the script
git-svn-id: http://svn.openlayers.org/trunk/openlayers@953 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-16 17:11:06 +00:00
euzuro
54f37fe30a oops. carryover from google.js copy :-(
git-svn-id: http://svn.openlayers.org/trunk/openlayers@952 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-16 17:07:44 +00:00
euzuro
d15d941d68 we now can remove the getExtent() function from Google.js and VirtualEarth.js
git-svn-id: http://svn.openlayers.org/trunk/openlayers@951 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-16 16:56:15 +00:00
euzuro
3776a5d729 establish generic getExtent() function in Layer. Move resolution-based calculation up into Grid.js. This prevents infinite loops and is more useful to generic layers like Gmaps, VE, etc.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@950 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-16 16:55:20 +00:00
euzuro
629e62b82b protect google base layer functions from an uncentered gmaps object
git-svn-id: http://svn.openlayers.org/trunk/openlayers@949 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-16 16:41:54 +00:00
euzuro
460446f558 actually don't have to use hacked functions afterall :-)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@948 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-16 15:34:08 +00:00
euzuro
f013e9c2e5 removed auto-script loader from VirtualEarth.js, beginning adding accessor and translation functions so that it can be used as a base layer. still not complete.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@947 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-14 19:01:45 +00:00
euzuro
e645fb03ac update warning message to users
git-svn-id: http://svn.openlayers.org/trunk/openlayers@946 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-14 16:23:04 +00:00
euzuro
35aebd03fd give the warning message a bit of padding
git-svn-id: http://svn.openlayers.org/trunk/openlayers@945 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-14 15:51:37 +00:00
euzuro
e5dbb97ef2 even if the wrong key is provided to gmaps, it still loads the GMap2 object. When you try to instantiate it, however, it errors. So we use a try statement and on error, we display the warning message. Nice
git-svn-id: http://svn.openlayers.org/trunk/openlayers@944 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-14 15:51:01 +00:00
euzuro
eb6c2a6346 first step of deprecating copyOf() functions, to be replaced with clone()
git-svn-id: http://svn.openlayers.org/trunk/openlayers@943 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-14 12:59:08 +00:00
euzuro
a3aa327d2f only add extra urls if this.urls actually exists
git-svn-id: http://svn.openlayers.org/trunk/openlayers@942 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-13 12:42:19 +00:00
euzuro
bd9ee403f2 updates to allow a wfs layer to query multiple wfs servers with the same parameters. untested, but all tests pass.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@941 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-13 12:33:22 +00:00
euzuro
1e5e8d1490 coding standards
git-svn-id: http://svn.openlayers.org/trunk/openlayers@940 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-13 11:26:38 +00:00
euzuro
9eb4f1967e fix calculation for random ids
git-svn-id: http://svn.openlayers.org/trunk/openlayers@939 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-12 01:53:03 +00:00
euzuro
68e58ab679 comments and spacing
git-svn-id: http://svn.openlayers.org/trunk/openlayers@938 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-12 00:35:46 +00:00
euzuro
488b41a50b put destroy after init
git-svn-id: http://svn.openlayers.org/trunk/openlayers@937 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-12 00:34:47 +00:00
euzuro
ec33ac4a84 give Control classes same setMap() functionality as Layer
git-svn-id: http://svn.openlayers.org/trunk/openlayers@936 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-12 00:16:14 +00:00
euzuro
a52b1fc8f1 update moveTo() function to take the 'minor' argument
git-svn-id: http://svn.openlayers.org/trunk/openlayers@935 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-11 15:06:06 +00:00
euzuro
e0e5dd544b update comment, adding 'minor' param
git-svn-id: http://svn.openlayers.org/trunk/openlayers@934 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-11 14:55:50 +00:00
euzuro
63e0242ca9 update comment
git-svn-id: http://svn.openlayers.org/trunk/openlayers@933 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-11 14:54:34 +00:00
euzuro
fe6ede2c87 check for transparency was not correct
git-svn-id: http://svn.openlayers.org/trunk/openlayers@932 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-11 13:52:16 +00:00
euzuro
ba157b6645 update clone to correct class name
git-svn-id: http://svn.openlayers.org/trunk/openlayers@931 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-11 12:18:34 +00:00
euzuro
d747bc1d83 rewrite of Untiled.js to only create the div's once, and from then on just modify the attributes. this should be faster.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@930 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-11 12:17:59 +00:00
euzuro
1fa74c7c68 rewrite of Untiled class to use HTTPRequest class and not to use the Grid.js class. This speeds it up a bit, I think. all tests still pass.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@929 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-11 01:15:59 +00:00
euzuro
a6870c66b0 grid's moveTo should also accept 'minor' even though it won't do anything with it.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@928 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-11 01:12:47 +00:00
euzuro
3030c421b5 if we allow a non-minor setCenter to get into this loop, then even if the last setCenter() on a drag is to the same center point and zoom, the moveTo()s of the layers will still get called with non-minor parameter -- in the case of Untiled, we need this to redraw the layer on move end.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@927 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-11 01:01:23 +00:00
euzuro
5a5c0f349d somehow this got left off during the LayersReworking fiasco. Luckily only Untiled.js was actually using it. tests seem to pass, seems alright
git-svn-id: http://svn.openlayers.org/trunk/openlayers@926 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-11 00:50:32 +00:00
crschmidt
37e47ad612 Added rounding in updateScale().
git-svn-id: http://svn.openlayers.org/trunk/openlayers@925 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-08 06:35:47 +00:00
crschmidt
3d59c93b9d Removed unnecessary base param from Scale control.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@924 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-08 06:20:36 +00:00
Schuyler Erle
70df45d160 Created scale indicator based on Chris's Permalink.js.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@923 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-08 06:17:33 +00:00
Schuyler Erle
3a018dbb45 Declared vars in Permalink.js as lexical.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@922 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-08 06:05:48 +00:00
euzuro
03272cc894 add tests for passing null values to translation functions
git-svn-id: http://svn.openlayers.org/trunk/openlayers@921 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-07 17:05:16 +00:00
euzuro
6f17fbf54a configure google zoom translation to return null if null passed in
git-svn-id: http://svn.openlayers.org/trunk/openlayers@920 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-07 17:00:34 +00:00
euzuro
b0d9a997c1 update comments
git-svn-id: http://svn.openlayers.org/trunk/openlayers@919 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-07 16:58:23 +00:00
euzuro
8e2448413e add tests for google layer
git-svn-id: http://svn.openlayers.org/trunk/openlayers@918 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-07 16:45:09 +00:00
euzuro
5769205acb give google layer a destroy() function
git-svn-id: http://svn.openlayers.org/trunk/openlayers@917 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-07 16:05:14 +00:00
euzuro
b84b3763a6 remove fixed layers from the viewport, not the layercontainer
git-svn-id: http://svn.openlayers.org/trunk/openlayers@916 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-07 16:04:32 +00:00
euzuro
83fe2a828a created new GMaps API key for higher level directory. this way we can use the same key for the tests
git-svn-id: http://svn.openlayers.org/trunk/openlayers@915 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-07 15:46:48 +00:00
euzuro
f8e38a7b4d change heading on example
git-svn-id: http://svn.openlayers.org/trunk/openlayers@914 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-07 15:28:08 +00:00
euzuro
e9d7ff12b4 add GMaps API key for http://openlayers.org/dev/examples/
git-svn-id: http://svn.openlayers.org/trunk/openlayers@913 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-07 15:27:03 +00:00
euzuro
517282baa4 if gmaps is unable to load, well then we will show the user some help
git-svn-id: http://svn.openlayers.org/trunk/openlayers@912 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-07 14:50:46 +00:00
euzuro
2897834520 tag fromLatLngToContainerPixel() function directly onto the GMap2 object. Cleaner code. Easier to distinguish where the hack is, and it is not completely separate of any OL code.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@911 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-07 13:20:33 +00:00
euzuro
10d55bd72a remove document.write() call that loaded the gmaps script in google.js. from now on, the user is responsible for adding that script tag to his/her page. Add a test to make sure gmaps code base is loaded before trying to initialize new gmap2. update isBaseLayer() to return true only if gmaps is correctly loaded. finally, protect all methods if this.gmap is null, do nothing. update OpenLayers.js to now include Google.js and library.cfg to not exclude it.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@910 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-07 12:55:39 +00:00
euzuro
3b1545eadc if we cant translate our lonlat to px, then dont try to draw.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@909 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-07 12:22:01 +00:00
euzuro
d4587b06c0 make sure grid is set before trying to reinit tiles
git-svn-id: http://svn.openlayers.org/trunk/openlayers@908 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 17:08:49 +00:00
euzuro
a6d4a42058 add a destroy() function and a clone() function -- they are mostly empty but they are there for people to add on. Also added a check to make sure that a grid has been loaded before trying to re-init tiles after a mergeParams. added extensive tests.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@907 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 17:07:51 +00:00
euzuro
9b263461c0 update comments to reflect new function name
git-svn-id: http://svn.openlayers.org/trunk/openlayers@906 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 16:55:42 +00:00
euzuro
0144ee66ab fix the require
git-svn-id: http://svn.openlayers.org/trunk/openlayers@905 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 15:39:10 +00:00
euzuro
19adc2b155 require httprequest, not layer
git-svn-id: http://svn.openlayers.org/trunk/openlayers@904 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 15:27:03 +00:00
euzuro
304b61f8f8 add tests for Layer.Grid
git-svn-id: http://svn.openlayers.org/trunk/openlayers@903 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 13:04:04 +00:00
euzuro
aa30c9cae4 switch order of superclass.clone() (as in r901). then make sure that tileSize gets copied using copyOf(), and that the reference to the old grid does not get carried over.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@902 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 13:03:27 +00:00
euzuro
6b8bde0ff4 switch around order of call to superclass.clone() and the setting of noninit/nonsimple vars. that needs to be done *afterwards*. there is no functional difference in this commit -- it is only for good precedence.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@901 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 13:00:24 +00:00
euzuro
c13f7f5d4d copy the actual tileSize object, not just the reference.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@900 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 12:47:09 +00:00
euzuro
3d52b3e4c5 nullify all Grid-specific values. just for good measure
git-svn-id: http://svn.openlayers.org/trunk/openlayers@899 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 12:29:45 +00:00
euzuro
774db5dbca add test for visibility accessors for Layer
git-svn-id: http://svn.openlayers.org/trunk/openlayers@898 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 12:14:58 +00:00
euzuro
7f5ea40aca change function to use bl / tr
git-svn-id: http://svn.openlayers.org/trunk/openlayers@897 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 11:59:39 +00:00
euzuro
7b80623c5c update comment
git-svn-id: http://svn.openlayers.org/trunk/openlayers@896 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 10:46:57 +00:00
euzuro
986eaaf7a4 add hook to trigger the drawing of a layer upon addition to the map (assuming a center has been set)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@895 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 02:20:06 +00:00
euzuro
90933052aa give Grid a clone() function.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@894 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 02:19:04 +00:00
euzuro
8c6972bb06 uberminor change - spacing/alignment in jsdoc comments
git-svn-id: http://svn.openlayers.org/trunk/openlayers@893 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 02:05:24 +00:00
euzuro
43e1788f6f coding standards - no multiple returns
git-svn-id: http://svn.openlayers.org/trunk/openlayers@892 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 02:02:03 +00:00
euzuro
24503103b3 rearranging order of some functions, marking some of them private
git-svn-id: http://svn.openlayers.org/trunk/openlayers@891 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 01:57:53 +00:00
euzuro
f14a6049c1 coding standards for Grid.js
git-svn-id: http://svn.openlayers.org/trunk/openlayers@890 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 01:51:14 +00:00
euzuro
353c7b810d jsdoc Grid.js
git-svn-id: http://svn.openlayers.org/trunk/openlayers@889 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 01:39:19 +00:00
euzuro
b848e824d7 modify Grid to use HTTPRequest, update WMS & WFS with their necessary specifications -- capitalizing all parameters and adding SRS param from getProjection()
git-svn-id: http://svn.openlayers.org/trunk/openlayers@888 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 01:28:48 +00:00
euzuro
5debdb69ec make sure clone() of a layer does not copy the reference in the 'map' property. that should always be null as a cloned layer will still need to be added to the map via map.addLayer()
git-svn-id: http://svn.openlayers.org/trunk/openlayers@887 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 01:02:02 +00:00
euzuro
4182cc1955 adding new HTTPRequest class that adds a 'url' and 'params' properties to a Layer, and gives a getFullRequestString() function. Thorough tests.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@886 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-06 00:32:11 +00:00
euzuro
dfbbd74d00 tighten up tests for Layer
git-svn-id: http://svn.openlayers.org/trunk/openlayers@885 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-05 16:24:09 +00:00
euzuro
96a32e8fb0 make a safe copy of options on initialization, utilize applyDefaults() on clone to pick up stray addons. dont need the if in addOptions, as extend can safely handle a null source
git-svn-id: http://svn.openlayers.org/trunk/openlayers@884 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-05 15:31:08 +00:00
euzuro
23c2ea1c04 set all properties of layer to null on destroy. add test.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@883 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 23:55:34 +00:00
euzuro
63e0b37c67 lets have clone() just take no arguments and return an exact copy. then we can add modify functions that can be used to set the particular things the user wants changed, and s/he can do it him/herself. also a change here is that layer.options will always be initialized, never null.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@882 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 17:48:50 +00:00
euzuro
199ad05b5c readability, setting precedent.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@881 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 17:00:52 +00:00
euzuro
9cb9f6200c fix class name. coding standards
git-svn-id: http://svn.openlayers.org/trunk/openlayers@880 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 16:48:09 +00:00
euzuro
f528178e53 add clone() method to Layer class, add test.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@879 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 16:32:08 +00:00
euzuro
9149468971 store a reference to the options. this will be used for cloning.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@878 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 15:49:05 +00:00
euzuro
718d84d6d2 when cloning an icon, set the calculateOffset() function too, if it exists.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@877 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 15:30:11 +00:00
euzuro
4ba3a290b8 change these alerts so as not to confuse ourselves when grepping for alerts to remove debugging code. :-)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@876 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 14:02:02 +00:00
euzuro
076632122b update triggerEvent() so that it doesnt bomb if user tries to trigger a non-enabled event. Added thorough testing.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@875 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 13:54:04 +00:00
euzuro
91f17f20ff added some more just-in-case tests to test the unregister() function
git-svn-id: http://svn.openlayers.org/trunk/openlayers@874 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 13:27:51 +00:00
euzuro
56472f15a0 protect unregister() from someone trying to unregister an un-enabled event. total extreme case, but whatever. added test.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@873 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 13:23:11 +00:00
euzuro
83eb0e1b34 do not let users register on an event that has not been specifically enabled at initialize. add test.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@872 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 13:18:16 +00:00
euzuro
585ec9e192 fix remove() function and add test
git-svn-id: http://svn.openlayers.org/trunk/openlayers@871 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 13:13:41 +00:00
euzuro
abac8a5d44 fixed functionality of unregister() function, added ability to pass null value for obj. Added tests.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@870 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 12:57:34 +00:00
euzuro
7d6f4dea78 changing functionality of Events.register(). Now if a null callback is passed in, no action is taken. If a null *obj* is passed in, however, the obj used is this.object (the Events Object's related object). Added tests to make sure this works.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@869 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 12:44:29 +00:00
euzuro
7671f43bb1 updating tests for Events.js
git-svn-id: http://svn.openlayers.org/trunk/openlayers@868 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 12:37:02 +00:00
euzuro
e59c5e08f3 once property is set, use it instead of the argument.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@867 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 11:58:38 +00:00
euzuro
10cbef9274 since we can technically register events for any domelement, there is no reason this variable should be named 'div'. Change it to 'element' and update its use everywhere.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@866 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 11:57:18 +00:00
euzuro
994e00ad20 add more complete comment to register function, sort of explaining binding.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@865 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 11:42:20 +00:00
euzuro
5544bbf134 adding commenting/readability to initialize()
git-svn-id: http://svn.openlayers.org/trunk/openlayers@864 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 11:25:54 +00:00
euzuro
1301102b1a adding commenting/readability to triggerEvent()
git-svn-id: http://svn.openlayers.org/trunk/openlayers@863 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 11:18:06 +00:00
euzuro
9746ac23fe adding comments, coding standards, jsdoc
git-svn-id: http://svn.openlayers.org/trunk/openlayers@862 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 11:10:27 +00:00
euzuro
2bea4fed77 jsdoc
git-svn-id: http://svn.openlayers.org/trunk/openlayers@861 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-04 10:34:15 +00:00
euzuro
397b4cc7ba hack to catch as best as possible the resize event in both mozilla and IE. we cant catch the actual resize on the div in IE, so we do that. in mozilla the best we can do is catch the resize of the window. so that is what we do.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@860 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-03 20:08:02 +00:00
euzuro
65ae34d4e7 add contains() function to string library. added tests too.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@859 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-03 19:54:00 +00:00
euzuro
74b3e153f8 add a location so that init GeoRSS does not crash. Now all tests pass again
git-svn-id: http://svn.openlayers.org/trunk/openlayers@858 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-03 14:19:30 +00:00
euzuro
98302beddd same-case these functions for if there is no baselayer. in theory,
these should never be called if no baselayer is set... but one never
knows what a user will do. So instead of crashing, we will just return null.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@857 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-03 14:11:48 +00:00
euzuro
af5e930c0a coding standards
git-svn-id: http://svn.openlayers.org/trunk/openlayers@856 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-03 00:15:42 +00:00
euzuro
e34d5e2e96 jsdoc
git-svn-id: http://svn.openlayers.org/trunk/openlayers@855 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-03 00:06:28 +00:00
euzuro
c776967e66 looks like the theArgs controls and layers should be initialized as comma separated string values, rather than arrays. also remove repeated line
git-svn-id: http://svn.openlayers.org/trunk/openlayers@854 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-02 20:48:00 +00:00
euzuro
16d9da1268 coding standards
git-svn-id: http://svn.openlayers.org/trunk/openlayers@853 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-02 18:49:07 +00:00
euzuro
70af5bbb7f jsdoc
git-svn-id: http://svn.openlayers.org/trunk/openlayers@852 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-02 18:43:50 +00:00
crschmidt
50c00d35d9 Fix a lint error in Javascript, thanks to Safari. (Found by a user of the Boston Freemap.)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@850 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-01 19:36:42 +00:00
crschmidt
32acc4ad3a Change MVS example to use Util.getArgs(), now that it exists.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@849 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-01 14:07:42 +00:00
crschmidt
7f6ffe8164 Factor out getArgs into Util class, since we use it in other places as well. Modify Permalink Control to fit.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@848 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-01 14:05:34 +00:00
crschmidt
15a47c6513 Add support to Permalink control to automatically create Permalink inside map div if no element is given. This isn't pretty, but it's a good way to quickly/easily add a permalink to your map.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@847 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-01 02:41:21 +00:00
crschmidt
9f0a77aa92 Add PermaLink control. Add test for permalink control. This control will automatically center and zoom the map to lat/lon/zoom args, and allows you to set an <a> element whose href is modified when the map moves. controls.html implements an example.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@846 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-01 02:14:03 +00:00
crschmidt
72e44d6638 Commit GeoRSS tests.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@845 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-01 01:32:18 +00:00
crschmidt
0389b8cfb5 Er, right. bitnerd did the original here, not hobu :)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@844 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-07-01 00:03:08 +00:00
crschmidt
2117aa0539 Commit a 'changeParams' method, along with test and example, to show how it would be possible to use WMS-T with changeParams. ChangeParams sets the new params, then recalls initTiles with the new params set.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@843 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-30 23:59:42 +00:00
crschmidt
c958f9f88a KaMap needs to reimplement initTiles because it uses 0-based indexing instead of lower-left corner indexing, which means that we need to have the tile.draw method also modified here to use this.alpha, and also add the options hash as a param. We should probably move resolution/units into the options param too?
git-svn-id: http://svn.openlayers.org/trunk/openlayers@842 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-30 15:49:48 +00:00
crschmidt
7313838f1f Grid.js has two other tile.draw methods, which need to now use the this.alpha flag.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@841 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-30 15:48:50 +00:00
Schuyler Erle
44fee8a018 Added an 'alpha' option to Layer.Grid by which Layers can have the PNG alpha hack enabled on a per-Layer basis.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@840 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-30 15:41:40 +00:00
crschmidt
b064dce7f5 Ignore files starting with ".". On MacOS, these may be resource forks, but in any case, ignoring dotfiles is relatively standard practice.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@839 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-30 04:10:14 +00:00
euzuro
2e79e399b2 updated comment
git-svn-id: http://svn.openlayers.org/trunk/openlayers@836 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-30 01:12:03 +00:00
euzuro
aaa0555b7a the case is never closed, and the sun never sets. this is old code that is no longer used.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@835 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-30 01:07:02 +00:00
euzuro
a02c0ea8b7 you wanted viewportpx from latlon? well, you got it mister. using a small and but ingenious hack by the astute dr. steven erle, we are able to fix the last remaining (famous last words) kink in the google layer. seems like it should be all a-o-k now. Changed the getLonLatFromViewPortPx() to use the Container as well. Case closed.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@834 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-30 01:04:10 +00:00
crschmidt
5524399a3e This is a demo of using OpenLayers.Layer.WMS to fetch from a non-WMS source, specifically, OpenStreetMap. However, it seems that there's something wrong with the source data here, since there's a definite disconnect at tile boundaries.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@833 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-30 00:16:33 +00:00
euzuro
afeb15b3e7 set defaults correctly
git-svn-id: http://svn.openlayers.org/trunk/openlayers@832 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-29 23:24:48 +00:00
crschmidt
4fe8729895 Commit new version of MVS, nasa turned off by default.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@830 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-29 15:32:22 +00:00
crschmidt
a6f999970a Use OpenLayers.loadURL so that we get the benefit of ProxyHost.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@827 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-29 00:32:55 +00:00
crschmidt
d2270377ef We lost a whole bunch of MVS functionality when branching for 1.0. I'm not sure why.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@826 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-29 00:09:58 +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
43a2f03b2b the 'moveend' event was not getting properly triggered on the end of a drag... because the setCenter() was not passing a new center or zoom. move it outside the if clause and all is well.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@823 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-28 23:44:24 +00:00
crschmidt
b789fe22fd Change TIGER ka-Map example to be a freemap instance of ka-Map which caches the Open Plans tiger instead of using DM Solutions TIGER product demo.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@822 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-28 13:34:12 +00:00
crschmidt
d2d3eb075f We round these values to four decimale places: This saves us on rounding errors on the client-side, which could theoretically increase our cache size when we hit them, and in the case of the left/top values, this also makes sure that we get the closest pixel value, not the integer of it -- this is important when we get around to requesting the tiles, since otherwise we end up a pixel off, and then we don't get our images back.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@821 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-28 12:38:05 +00:00
crschmidt
dcb0f24f50 Move getZoomForExtent from WMS to Grid. This also applies to WorldWind and KaMap, so having it in Grid.js means we can use it in more cases where it will matter.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@820 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-28 02:51:37 +00:00
crschmidt
69c599b881 If there's no options passed, this would fail. So let's check that
git-svn-id: http://svn.openlayers.org/trunk/openlayers@819 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-28 02:38:05 +00:00
crschmidt
e7b45c4731 Commit change to WFS layer. It was breaking before, due to a lack of tileSize. This is not fixed, but is a temporary patch until I figure out the deeper reasons why.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@818 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-28 02:32:59 +00:00
crschmidt
9ea5b2aa31 This is needed to allow KaMap and WorldWind to work. It may need to be removed in cases where it's not appropriate, but prevents infinite loops in the meantime (I think).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@817 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-28 02:21:30 +00:00
crschmidt
38324e7295 Change Grid to not setTileSize if the tileSize passed is null. Also change WFS to not call setTileSize if it's null.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@816 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-28 00:33:28 +00:00
crschmidt
0763e08c12 If we don't have a tileSize when we're cloning, that means we're going to pick up the default from the Map Real Soon Now (tm), so we'll just not bother setting the tile size on our cloned layer.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@815 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-28 00:29:39 +00:00
crschmidt
843abf10bb Let's keep null around. At least one example (*cough* openlayers homepage *cough*) uses it, although that should obviously have been documented in a test.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@814 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-28 00:07:00 +00:00
crschmidt
162d05cb25 Convert KaMap and WorldWind to be isBaseLayers, and change FullExtent to MaxExtent.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@813 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 23:51:01 +00:00
crschmidt
239a1cefa9 Actually return the extent.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@812 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 23:49:18 +00:00
euzuro
f51e970ab1 oops. our API promises zoomToFullExtent() and getFullExtent(), so we have to deliver them. Agreed that the name change to max should stay, but for the time being, have to maintain our API. both of these functions are marked as deprecated, and a ticket is being made to eventually remove them.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@811 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 23:47:36 +00:00
crschmidt
7d810b47d1 Change zoomToFullExtent to zoomToMaxExtent.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@810 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 23:47:28 +00:00
euzuro
1cf12e8d34 set the options *after* the call to updateSize() has been made
git-svn-id: http://svn.openlayers.org/trunk/openlayers@809 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 23:39:19 +00:00
euzuro
563d91c4fd extra dereferencing.... copy/paste error
git-svn-id: http://svn.openlayers.org/trunk/openlayers@808 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 23:35:05 +00:00
euzuro
9b53d22a31 allow for accessing of default map values even if baseLayer has still not been set
git-svn-id: http://svn.openlayers.org/trunk/openlayers@807 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 23:31:47 +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
crschmidt
63bd624827 Commit change to GeoRSS -- once we parse the RSS file, set the layer name.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@804 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 22:20:37 +00:00
crschmidt
102820ad77 Commit a GeoRSS example which allows you to enter the URL yourself, and display multiple GeoRSS results.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@803 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 20:23:37 +00:00
crschmidt
c20390c864 KaMap can't round. It works fine for degrees, but when you're working in inches, feet, meters, the rounding errors become quite significant.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@802 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 20:17:37 +00:00
crschmidt
6abc62718c aughhhh. This pains me, but it's in the spec. (Support ',' as a seperator for georss:point data.)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@793 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 12:53:50 +00:00
crschmidt
f62eb0f687 Make the world fit in the map window using auto.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@791 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 12:33:27 +00:00
euzuro
f4342723e4 use bound's built in getCenter() function.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@790 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 10:47:48 +00:00
Schuyler Erle
fbbf1b317a Applied Corey Puffault's zoomToExtent() patch from #107.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@789 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 04:42:17 +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
crschmidt
ef65e851b9 Fix ProxyHost.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@784 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 04:05:29 +00:00
crschmidt
067bbb5d75 Refactor GeoRSS Layer to support 'real' GeoRSS :) (geo:lat, geo:lon).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@783 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 04:04:41 +00:00
crschmidt
d7bb634cce Add GeoRSS layer and example. Only support for georss:point for the time being. Probably has a fair number of cases where it can fail, but it works for a first run, and the community can build from here :)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@778 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 03:35:55 +00:00
crschmidt
35a73b2942 Build Ka-Map support by default. (Note that this is in trunk, *not* 1.0: 1.0 will not include ka-Map support).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@773 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-26 16:58:04 +00:00
crschmidt
05025e97d0 Round the scale value. KaMap rounds internally, so adding extra precision here only breaks client-side caching.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@766 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-26 14:29:37 +00:00
crschmidt
3546cad5a1 Add more descriptive names to the example.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@765 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-26 13:55:45 +00:00
crschmidt
a3e5944e4e KaMap layer now sublasses initTiles, to implement the kamap 0-based tiling scheme instead of the OpenLayers/WW -180,-90 method. This means that there are no longer any restrictions on using ka-Map with other layers! woohoo! You can use ka-map on top of WorldWind, or with another ka-map layer, even if it has differently sized tiles. yay!
git-svn-id: http://svn.openlayers.org/trunk/openlayers@764 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-26 13:54:14 +00:00
crschmidt
1912d4355c OpenLayers.Layer.KaMap is now working much better. The TIGER example which was just a hack before is now working properly, and there's an actual scale calculation being performed based on params passed into the constructor of 'units' and 'resolution', both of which are determined by the mapfile. The only limitation yet to be tackled is that maxResolution on the map must split the map up such that 0,0 is a tile corner. This requires subclassing more (or perhaps all) of the Layer.Grid functions, so I'm off to do that now.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@763 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-26 13:15:20 +00:00
Schuyler Erle
c43a44dc75 Pulled down documentation and build.sh fixes from 1.0 branch.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@716 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-23 15:30:43 +00:00
crschmidt
83e1317b38 Commit Urban demo for WW. This lets you browse around and look at hte high-res urban density data.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@697 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-23 05:10:04 +00:00
crschmidt
e3e192f869 Commit change to worldwind layer so you can turn off landsat and see bathy layer. They only overlap at one zoom.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@696 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-23 04:21:59 +00:00
crschmidt
e0c564c0e3 Add worldwind support to OpenLayers. To define a worldwind layer, you need a URL, a lzd (level zero degrees), a maxZoom level, and a param name 'T' to define the map you're pulling from.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@695 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-23 04:20:46 +00:00
crschmidt
bd166b5ac1 Fix tests for Tile.Image // Layer.WMS changes for alphaImage #96.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@688 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-22 19:52:39 +00:00
crschmidt
809f1da955 Update the freemap example to explicitly state that the upper layers are transparent, to work with new code.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@684 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-22 19:11:29 +00:00
crschmidt
891fdf7a38 'true', in quotes, not true. we're checking the value that's being passed through to the WMS server.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@683 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-22 19:11:09 +00:00
crschmidt
50babaeb34 Also pass the transparent param on to addTile in the column/row functions.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@682 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-22 19:10:44 +00:00
crschmidt
8e0793b191 Only draw transparent images if the tiles are transparent.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@681 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-22 19:02:33 +00:00
crschmidt
7584d12ae5 Turn off selecting in IE, so we don't end up selecting tiles while dragging a box.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@680 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-22 18:53:36 +00:00
crschmidt
2dc364f417 In IE, we use the image hack, so changing the img.src doesn't help.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@679 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-22 18:47:51 +00:00
162 changed files with 13257 additions and 3629 deletions

View File

@@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://web.resource.org/cc/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="18.000000px"
height="18.000000px"
id="svg2"
sodipodi:version="0.32"
inkscape:version="0.43"
sodipodi:docbase="/home/sderle/projects/openlayers/layerswitcher/art"
sodipodi:docname="layer-switcher-maximize.svg"
inkscape:export-filename="/Users/phil/Documents/work/metacarta/2svn.openlayers.net/follower/code/b-edits-1/openlayers/assets/ui_elements/zoom-minus-mini.png"
inkscape:export-xdpi="90.000000"
inkscape:export-ydpi="90.000000">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="16"
inkscape:cx="9"
inkscape:cy="9"
inkscape:document-units="px"
inkscape:current-layer="layer4"
inkscape:window-width="1226"
inkscape:window-height="800"
inkscape:window-x="42"
inkscape:window-y="25" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="background"
inkscape:groupmode="layer"
id="layer1">
<g
id="g2110"
transform="matrix(-7.849624e-17,1,-1,-7.849624e-17,18,0)">
<path
transform="matrix(0,-1.00316,1.00316,0,-2.844e-2,18.02844)"
d="M 17.971654 9 A 8.9716539 8.9716539 0 1 1 0.028346062,9 A 8.9716539 8.9716539 0 1 1 17.971654 9 z"
sodipodi:ry="8.9716539"
sodipodi:rx="8.9716539"
sodipodi:cy="9"
sodipodi:cx="9"
id="path2059"
style="fill:#00008b;fill-opacity:1;stroke:none;stroke-width:39.98414612;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
sodipodi:type="arc" />
<rect
transform="matrix(0,-1,1,0,0,0)"
y="4.3599998e-06"
x="-9.0000048"
height="18"
width="9"
id="rect2061"
style="fill:#00008b;fill-opacity:1;stroke:none;stroke-width:39.98414612;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</g>
<g
inkscape:groupmode="layer"
id="layer4"
inkscape:label="zoom"
style="display:inline">
<text
xml:space="preserve"
style="font-size:18px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;display:inline;font-family:Helvetica"
x="1.5214844"
y="-3.2949219"
id="text2114"
sodipodi:linespacing="125%"
transform="scale(1,-1)"><tspan
sodipodi:role="line"
id="tspan2118"
x="1.5214844"
y="-3.2949219">+</tspan></text>
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="overlay"
style="display:none">
<path
style="font-size:12.000000px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125.00000%;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Verdana"
d="M 2.9678210,9.0332227 C 2.9678314,9.5015070 3.1752531,9.8938504 3.5900866,10.210254 C 3.6463464,10.254553 3.9451742,10.453889 4.4865710,10.808262 L 8.1568835,13.247754 C 8.2693886,13.323691 8.4240759,13.393300 8.6209460,13.456582 C 8.8107943,13.519862 9.0041535,13.551503 9.2010240,13.551504 C 9.5736843,13.551503 9.8936056,13.431269 10.160789,13.190801 C 10.427980,12.950332 10.561574,12.659238 10.561572,12.317520 C 10.561574,11.861896 10.322511,11.488536 9.8443836,11.197442 L 8.5998522,10.428575 L 14.548408,10.428575 C 15.026535,10.428577 15.406221,10.298849 15.687470,10.039395 C 15.968721,9.7799443 16.109345,9.4318977 16.109345,8.9952540 C 16.109345,8.5396330 15.961690,8.1915865 15.666377,7.9511133 C 15.364034,7.7106494 14.980831,7.5904152 14.516767,7.5904102 L 8.6314928,7.5904102 L 9.9920390,6.7076368 C 10.160793,6.5937365 10.290871,6.4481897 10.382274,6.2709962 C 10.466652,6.0874870 10.508840,5.8913153 10.508837,5.6824805 C 10.508840,5.3281127 10.378761,5.0338552 10.118602,4.7997070 C 9.8584498,4.5655745 9.5279814,4.4485043 9.1271961,4.4484962 C 8.7615757,4.4485043 8.4029823,4.5624104 8.0514147,4.7902149 L 3.9697741,7.5239649 C 3.6393151,7.7454540 3.4002529,7.9542820 3.2525866,8.1504493 C 3.0627532,8.3972503 2.9678314,8.6756875 2.9678210,8.9857618 L 2.9678210,9.0332227"
id="text2082"
sodipodi:nodetypes="csccsssscccssscccssssccscc" />
</g>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="pan triangle"
style="display:none">
<path
sodipodi:type="star"
style="fill:#ffffff;fill-opacity:1.0000000;stroke:none;stroke-width:39.984146;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
id="path2107"
sodipodi:sides="3"
sodipodi:cx="6.8031497"
sodipodi:cy="5.1874018"
sodipodi:r1="5.0880113"
sodipodi:r2="2.5440056"
sodipodi:arg1="1.0471976"
sodipodi:arg2="2.0943951"
inkscape:flatsided="false"
inkscape:rounded="0.0000000"
inkscape:randomized="0.0000000"
d="M 9.3471551,9.5937489 L 5.5311469,7.3905753 L 1.7151384,5.1874015 L 5.5311469,2.9842283 L 9.3471555,0.78105489 L 9.3471553,5.1874018 L 9.3471551,9.5937489 z "
transform="matrix(0.000000,-1.331000,1.331000,0.000000,2.038879,16.92102)" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@@ -0,0 +1,142 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://web.resource.org/cc/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
inkscape:export-ydpi="90.000000"
inkscape:export-xdpi="90.000000"
inkscape:export-filename="/home/sderle/projects/openlayers/layerswitcher/img/layer-switcher-minimize.png"
sodipodi:docname="layer-switcher-minimize.svg"
sodipodi:docbase="/home/sderle/projects/openlayers/layerswitcher/art"
inkscape:version="0.43"
sodipodi:version="0.32"
id="svg2"
height="18.000000px"
width="18.000000px">
<defs
id="defs4" />
<sodipodi:namedview
inkscape:window-y="26"
inkscape:window-x="42"
inkscape:window-height="800"
inkscape:window-width="1226"
inkscape:current-layer="layer1"
inkscape:document-units="px"
inkscape:cy="9.3025513"
inkscape:cx="9"
inkscape:zoom="16"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
borderopacity="1.0"
bordercolor="#666666"
pagecolor="#ffffff"
id="base" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
style="display:inline"
id="layer1"
inkscape:groupmode="layer"
inkscape:label="background">
<rect
style="fill:#00008b;fill-opacity:0;stroke:none;stroke-width:39.984146;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000"
id="rect2061"
width="18.014498"
height="18.000000"
x="-18.014502"
y="4.3599998e-06"
transform="matrix(0.000000,-1.000000,1.000000,0.000000,0.000000,0.000000)"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
inkscape:export-filename="/home/sderle/projects/openlayers/layerswitcher/art/layer-switcher-minimize.png" />
</g>
<g
inkscape:label="graticule"
id="layer5"
inkscape:groupmode="layer">
<text
xml:space="preserve"
style="font-size:18px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;display:inline;font-family:Helvetica"
x="5.2802601"
y="-3.8032362"
id="text1432"
sodipodi:linespacing="125%"
transform="scale(1,-1)"><tspan
sodipodi:role="line"
id="tspan1434"
x="5.2802601"
y="-3.8032362">-</tspan></text>
<rect
style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.99699599px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
id="rect1438"
width="13.003004"
height="13.002999"
x="2.498498"
y="2.4984975" />
</g>
<g
style="display:none"
inkscape:label="zoom"
id="layer4"
inkscape:groupmode="layer">
<text
transform="scale(1.000000,-1.000000)"
sodipodi:linespacing="125.00000%"
id="text2114"
y="-3.4077148"
x="3.7485352"
style="font-size:18.000000;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#ffffff;fill-opacity:1.0000000;stroke:#ffffff;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1.0000000;font-family:Helvetica;text-anchor:start;writing-mode:lr-tb"
xml:space="preserve"><tspan
y="-3.4077148"
x="3.7485352"
id="tspan2118"
sodipodi:role="line"></tspan></text>
</g>
<g
style="display:none"
inkscape:label="overlay"
id="layer2"
inkscape:groupmode="layer">
<path
sodipodi:nodetypes="csccsssscccssscccssssccscc"
id="text2082"
d="M 2.9678210,9.0332227 C 2.9678314,9.5015070 3.1752531,9.8938504 3.5900866,10.210254 C 3.6463464,10.254553 3.9451742,10.453889 4.4865710,10.808262 L 8.1568835,13.247754 C 8.2693886,13.323691 8.4240759,13.393300 8.6209460,13.456582 C 8.8107943,13.519862 9.0041535,13.551503 9.2010240,13.551504 C 9.5736843,13.551503 9.8936056,13.431269 10.160789,13.190801 C 10.427980,12.950332 10.561574,12.659238 10.561572,12.317520 C 10.561574,11.861896 10.322511,11.488536 9.8443836,11.197442 L 8.5998522,10.428575 L 14.548408,10.428575 C 15.026535,10.428577 15.406221,10.298849 15.687470,10.039395 C 15.968721,9.7799443 16.109345,9.4318977 16.109345,8.9952540 C 16.109345,8.5396330 15.961690,8.1915865 15.666377,7.9511133 C 15.364034,7.7106494 14.980831,7.5904152 14.516767,7.5904102 L 8.6314928,7.5904102 L 9.9920390,6.7076368 C 10.160793,6.5937365 10.290871,6.4481897 10.382274,6.2709962 C 10.466652,6.0874870 10.508840,5.8913153 10.508837,5.6824805 C 10.508840,5.3281127 10.378761,5.0338552 10.118602,4.7997070 C 9.8584498,4.5655745 9.5279814,4.4485043 9.1271961,4.4484962 C 8.7615757,4.4485043 8.4029823,4.5624104 8.0514147,4.7902149 L 3.9697741,7.5239649 C 3.6393151,7.7454540 3.4002529,7.9542820 3.2525866,8.1504493 C 3.0627532,8.3972503 2.9678314,8.6756875 2.9678210,8.9857618 L 2.9678210,9.0332227"
style="font-size:12.000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#ffffff;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Verdana;text-anchor:start;writing-mode:lr-tb" />
</g>
<g
style="display:none"
inkscape:label="pan triangle"
id="layer3"
inkscape:groupmode="layer">
<path
transform="matrix(0.000000,-1.331000,1.331000,0.000000,2.038879,16.92102)"
d="M 9.3471551,9.5937489 L 5.5311469,7.3905753 L 1.7151384,5.1874015 L 5.5311469,2.9842283 L 9.3471555,0.78105489 L 9.3471553,5.1874018 L 9.3471551,9.5937489 z "
inkscape:randomized="0.0000000"
inkscape:rounded="0.0000000"
inkscape:flatsided="false"
sodipodi:arg2="2.0943951"
sodipodi:arg1="1.0471976"
sodipodi:r2="2.5440056"
sodipodi:r1="5.0880113"
sodipodi:cy="5.1874018"
sodipodi:cx="6.8031497"
sodipodi:sides="3"
id="path2107"
style="fill:#ffffff;fill-opacity:1.0000000;stroke:none;stroke-width:39.984146;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000"
sodipodi:type="star" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@@ -1,36 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
<!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
<!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
]>
<svg version="1.1" id="Layer_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="28.375" height="28" viewBox="0 0 28.375 28"
overflow="visible" enable-background="new 0 0 28.375 28" xml:space="preserve">
<g i:extraneous="self">
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M27.875,1.375"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M0,1.375"/>
<path fill="none" stroke="#FFFFFF" d="M0,27.475"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,27.645"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,0.544"/>
<line fill="none" stroke="#00008B" x1="0.875" y1="27.5" x2="27.875" y2="27.475"/>
<rect x="0.875" y="1.045" fill="#00008B" width="27.125" height="26"/>
<line fill="none" stroke="#00008B" x1="27.875" y1="26.925" x2="27.875" y2="0.925"/>
<line fill="none" stroke="#FFFFFF" x1="1.375" y1="0.5" x2="27.375" y2="0.5"/>
<line fill="none" stroke="#FFFFFF" x1="0.875" y1="1" x2="0.875" y2="27"/>
<rect x="5.252" y="11.157" transform="matrix(0.7933 -0.6088 0.6088 0.7933 -5.1621 12.1086)" fill="#FFBF00" width="20" height="5"/>
<line fill="#FFBF00" stroke="#000000" x1="8.376" y1="15.783" x2="10.717" y2="18.766"/>
<line fill="#FFBF00" stroke="#000000" x1="11.946" y1="13.043" x2="14.288" y2="16.027"/>
<line fill="#FFBF00" stroke="#000000" x1="15.342" y1="10.437" x2="17.684" y2="13.42"/>
<line fill="#FFBF00" stroke="#000000" x1="18.69" y1="7.869" x2="21.03" y2="10.852"/>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
<!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
<!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
]>
<svg version="1.1" id="Layer_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="28.375" height="28" viewBox="0 0 28.375 28"
overflow="visible" enable-background="new 0 0 28.375 28" xml:space="preserve">
<g i:extraneous="self">
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M27.875,1.375"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M0,1.375"/>
<path fill="none" stroke="#FFFFFF" d="M0,27.475"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,27.645"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,0.544"/>
<line fill="none" stroke="#00008B" x1="0.875" y1="27.5" x2="27.875" y2="27.475"/>
<rect x="0.875" y="1.045" fill="#00008B" width="27.125" height="26"/>
<line fill="none" stroke="#00008B" x1="27.875" y1="26.925" x2="27.875" y2="0.925"/>
<line fill="none" stroke="#FFFFFF" x1="1.375" y1="0.5" x2="27.375" y2="0.5"/>
<line fill="none" stroke="#FFFFFF" x1="0.875" y1="1" x2="0.875" y2="27"/>
<rect x="5.252" y="11.157" transform="matrix(0.7933 -0.6088 0.6088 0.7933 -5.1621 12.1086)" fill="#FFBF00" width="20" height="5"/>
<line fill="#FFBF00" stroke="#000000" x1="8.376" y1="15.783" x2="10.717" y2="18.766"/>
<line fill="#FFBF00" stroke="#000000" x1="11.946" y1="13.043" x2="14.288" y2="16.027"/>
<line fill="#FFBF00" stroke="#000000" x1="15.342" y1="10.437" x2="17.684" y2="13.42"/>
<line fill="#FFBF00" stroke="#000000" x1="18.69" y1="7.869" x2="21.03" y2="10.852"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -1,36 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
<!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
<!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
]>
<svg version="1.1" id="Layer_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="28.375" height="28" viewBox="0 0 28.375 28"
overflow="visible" enable-background="new 0 0 28.375 28" xml:space="preserve">
<g i:extraneous="self">
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M27.875,1.375"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M0,1.375"/>
<path fill="none" stroke="#FFFFFF" d="M0,27.475"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,27.645"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,0.544"/>
<line fill="none" stroke="#FFFFFF" x1="0.875" y1="27.5" x2="27.875" y2="27.475"/>
<rect x="0.875" y="1.045" fill="#ADD8E6" width="27.125" height="26"/>
<line fill="none" stroke="#FFFFFF" x1="27.875" y1="26.925" x2="27.875" y2="0.925"/>
<line fill="none" stroke="#00008B" x1="1.375" y1="0.5" x2="27.375" y2="0.5"/>
<line fill="none" stroke="#00008B" x1="0.875" y1="1" x2="0.875" y2="27"/>
<rect x="4.252" y="12.157" transform="matrix(0.7933 -0.6088 0.6088 0.7933 -5.9776 11.7065)" fill="#FFBF00" width="20" height="5"/>
<line fill="#FFBF00" stroke="#000000" x1="7.376" y1="16.783" x2="9.717" y2="19.766"/>
<line fill="#FFBF00" stroke="#000000" x1="10.946" y1="14.043" x2="13.288" y2="17.027"/>
<line fill="#FFBF00" stroke="#000000" x1="14.342" y1="11.437" x2="16.684" y2="14.42"/>
<line fill="#FFBF00" stroke="#000000" x1="17.69" y1="8.869" x2="20.03" y2="11.852"/>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
<!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
<!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
]>
<svg version="1.1" id="Layer_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="28.375" height="28" viewBox="0 0 28.375 28"
overflow="visible" enable-background="new 0 0 28.375 28" xml:space="preserve">
<g i:extraneous="self">
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M27.875,1.375"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M0,1.375"/>
<path fill="none" stroke="#FFFFFF" d="M0,27.475"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,27.645"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,0.544"/>
<line fill="none" stroke="#FFFFFF" x1="0.875" y1="27.5" x2="27.875" y2="27.475"/>
<rect x="0.875" y="1.045" fill="#ADD8E6" width="27.125" height="26"/>
<line fill="none" stroke="#FFFFFF" x1="27.875" y1="26.925" x2="27.875" y2="0.925"/>
<line fill="none" stroke="#00008B" x1="1.375" y1="0.5" x2="27.375" y2="0.5"/>
<line fill="none" stroke="#00008B" x1="0.875" y1="1" x2="0.875" y2="27"/>
<rect x="4.252" y="12.157" transform="matrix(0.7933 -0.6088 0.6088 0.7933 -5.9776 11.7065)" fill="#FFBF00" width="20" height="5"/>
<line fill="#FFBF00" stroke="#000000" x1="7.376" y1="16.783" x2="9.717" y2="19.766"/>
<line fill="#FFBF00" stroke="#000000" x1="10.946" y1="14.043" x2="13.288" y2="17.027"/>
<line fill="#FFBF00" stroke="#000000" x1="14.342" y1="11.437" x2="16.684" y2="14.42"/>
<line fill="#FFBF00" stroke="#000000" x1="17.69" y1="8.869" x2="20.03" y2="11.852"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -1,44 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
<!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
<!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
]>
<svg version="1.1" id="Layer_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="28.375" height="28" viewBox="0 0 28.375 28"
overflow="visible" enable-background="new 0 0 28.375 28" xml:space="preserve">
<g i:extraneous="self">
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M27.875,1.375"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M0,1.375"/>
<path fill="none" stroke="#FFFFFF" d="M0,27.475"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,27.645"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,0.544"/>
<line fill="none" stroke="#00008B" x1="0.875" y1="27.5" x2="27.875" y2="27.475"/>
<rect x="0.875" y="1.045" fill="#00008B" width="27.125" height="26"/>
<line fill="none" stroke="#00008B" x1="27.875" y1="26.925" x2="27.875" y2="0.925"/>
<line fill="none" stroke="#FFFFFF" x1="1.375" y1="0.5" x2="27.375" y2="0.5"/>
<line fill="none" stroke="#FFFFFF" x1="0.875" y1="1" x2="0.875" y2="27"/>
<path fill="#FFFFFF" stroke="#000000" d="M9.458,22.458c-0.473-0.168-1.02-1.269-1.363-1.695
c-0.479-0.595-0.894-1.245-1.377-1.829c-0.733-0.887-1.356-1.729-1.854-2.764c-0.375-0.782-0.884-1.997-0.005-2.648
c1.036-0.767,2.095-0.162,2.934,0.479c0.844,0.646,1.729,1.18,2.526,1.869c-0.372-0.305-0.548-0.986-0.778-1.421
c-0.253-0.477-0.565-0.906-0.822-1.375c-0.359-0.657-0.767-1.201-1.21-1.823c-0.544-0.763-1.051-1.74-0.925-2.709
c0.133-1.025,0.972-1.527,1.924-1.207c1.202,0.405,1.969,1.692,2.627,2.698c0.636,0.971,1.201,2.159,1.938,3.042
c-0.222-0.209-0.148-0.508-0.155-0.782c-0.01-0.37-0.097-0.626-0.219-0.967c-0.162-0.455-0.219-0.972-0.24-1.45
c-0.034-0.776-0.25-1.465-0.25-2.247c0-0.988-0.14-1.963,0.71-2.631c0.666-0.523,1.649-0.764,2.381-0.248
c1.385,0.976,1.057,2.999,1.209,4.458c0.079,0.759,0.165,1.489,0.2,2.263c0.022,0.496,0.209,1.067,0.168,1.558
c-0.146-0.269-0.113-0.749-0.127-1.057c-0.022-0.502-0.041-0.982-0.115-1.47c-0.114-0.743-0.188-1.564-0.25-2.324
c-0.152-1.877,2.054-3.17,3.301-1.469c0.884,1.206,0.773,2.643,0.773,4.085c0,0.698-0.034,1.251-0.22,1.91
c-0.13,0.459-0.293,1.222-0.239,1.638c0-0.902,0.334-1.697,0.334-2.588c0-0.678-0.272-2.099,0.581-2.334
c1.065-0.294,2.008,0.875,2.428,1.66c0.458,0.855,0.555,1.901,0.409,2.882c-0.318,2.154-0.845,4.227-2.096,6.072
c-0.268,0.396-0.485,0.838-0.79,1.22c-0.361,0.452-0.923,0.772-1.416,1.071c-0.381,0.232-0.764,0.53-1.176,0.604
c-0.822,0.149-1.725,0.157-2.565,0.157c-1.29,0-2.564-0.068-3.832-0.251c-0.799-0.115-2.12,0.153-2.668-0.54"/>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
<!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
<!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
]>
<svg version="1.1" id="Layer_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="28.375" height="28" viewBox="0 0 28.375 28"
overflow="visible" enable-background="new 0 0 28.375 28" xml:space="preserve">
<g i:extraneous="self">
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M27.875,1.375"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M0,1.375"/>
<path fill="none" stroke="#FFFFFF" d="M0,27.475"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,27.645"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,0.544"/>
<line fill="none" stroke="#00008B" x1="0.875" y1="27.5" x2="27.875" y2="27.475"/>
<rect x="0.875" y="1.045" fill="#00008B" width="27.125" height="26"/>
<line fill="none" stroke="#00008B" x1="27.875" y1="26.925" x2="27.875" y2="0.925"/>
<line fill="none" stroke="#FFFFFF" x1="1.375" y1="0.5" x2="27.375" y2="0.5"/>
<line fill="none" stroke="#FFFFFF" x1="0.875" y1="1" x2="0.875" y2="27"/>
<path fill="#FFFFFF" stroke="#000000" d="M9.458,22.458c-0.473-0.168-1.02-1.269-1.363-1.695
c-0.479-0.595-0.894-1.245-1.377-1.829c-0.733-0.887-1.356-1.729-1.854-2.764c-0.375-0.782-0.884-1.997-0.005-2.648
c1.036-0.767,2.095-0.162,2.934,0.479c0.844,0.646,1.729,1.18,2.526,1.869c-0.372-0.305-0.548-0.986-0.778-1.421
c-0.253-0.477-0.565-0.906-0.822-1.375c-0.359-0.657-0.767-1.201-1.21-1.823c-0.544-0.763-1.051-1.74-0.925-2.709
c0.133-1.025,0.972-1.527,1.924-1.207c1.202,0.405,1.969,1.692,2.627,2.698c0.636,0.971,1.201,2.159,1.938,3.042
c-0.222-0.209-0.148-0.508-0.155-0.782c-0.01-0.37-0.097-0.626-0.219-0.967c-0.162-0.455-0.219-0.972-0.24-1.45
c-0.034-0.776-0.25-1.465-0.25-2.247c0-0.988-0.14-1.963,0.71-2.631c0.666-0.523,1.649-0.764,2.381-0.248
c1.385,0.976,1.057,2.999,1.209,4.458c0.079,0.759,0.165,1.489,0.2,2.263c0.022,0.496,0.209,1.067,0.168,1.558
c-0.146-0.269-0.113-0.749-0.127-1.057c-0.022-0.502-0.041-0.982-0.115-1.47c-0.114-0.743-0.188-1.564-0.25-2.324
c-0.152-1.877,2.054-3.17,3.301-1.469c0.884,1.206,0.773,2.643,0.773,4.085c0,0.698-0.034,1.251-0.22,1.91
c-0.13,0.459-0.293,1.222-0.239,1.638c0-0.902,0.334-1.697,0.334-2.588c0-0.678-0.272-2.099,0.581-2.334
c1.065-0.294,2.008,0.875,2.428,1.66c0.458,0.855,0.555,1.901,0.409,2.882c-0.318,2.154-0.845,4.227-2.096,6.072
c-0.268,0.396-0.485,0.838-0.79,1.22c-0.361,0.452-0.923,0.772-1.416,1.071c-0.381,0.232-0.764,0.53-1.176,0.604
c-0.822,0.149-1.725,0.157-2.565,0.157c-1.29,0-2.564-0.068-3.832-0.251c-0.799-0.115-2.12,0.153-2.668-0.54"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -1,44 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
<!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
<!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
]>
<svg version="1.1" id="Layer_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="28.375" height="28" viewBox="0 0 28.375 28"
overflow="visible" enable-background="new 0 0 28.375 28" xml:space="preserve">
<g i:extraneous="self">
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M27.875,1.375"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M0,1.375"/>
<path fill="none" stroke="#FFFFFF" d="M0,27.475"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,27.645"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,0.544"/>
<line fill="none" stroke="#FFFFFF" x1="0.875" y1="27.5" x2="27.875" y2="27.475"/>
<rect x="0.875" y="1.045" fill="#ADD8E6" width="27.125" height="26"/>
<line fill="none" stroke="#FFFFFF" x1="27.875" y1="26.925" x2="27.875" y2="0.925"/>
<line fill="none" stroke="#00008B" x1="1.375" y1="0.5" x2="27.375" y2="0.5"/>
<line fill="none" stroke="#00008B" x1="0.875" y1="1" x2="0.875" y2="27"/>
<path fill="#FFFFFF" stroke="#000000" d="M8.458,23.458c-0.473-0.168-1.02-1.269-1.363-1.695
c-0.479-0.595-0.894-1.245-1.377-1.829c-0.733-0.887-1.356-1.729-1.854-2.764c-0.375-0.782-0.884-1.997-0.005-2.648
c1.036-0.767,2.095-0.161,2.934,0.479c0.844,0.646,1.729,1.18,2.526,1.869c-0.372-0.305-0.548-0.986-0.778-1.421
c-0.253-0.477-0.565-0.906-0.822-1.375c-0.359-0.657-0.767-1.201-1.21-1.823c-0.544-0.763-1.051-1.74-0.925-2.709
c0.133-1.025,0.972-1.527,1.924-1.207c1.202,0.405,1.969,1.692,2.627,2.698c0.636,0.971,1.201,2.159,1.938,3.042
c-0.222-0.21-0.148-0.509-0.155-0.783c-0.01-0.37-0.097-0.626-0.219-0.967c-0.162-0.455-0.219-0.972-0.24-1.45
c-0.034-0.776-0.25-1.465-0.25-2.247c0-0.988-0.14-1.963,0.71-2.631c0.666-0.523,1.649-0.764,2.381-0.248
c1.385,0.976,1.057,2.999,1.209,4.458c0.079,0.759,0.165,1.489,0.2,2.263c0.022,0.496,0.209,1.068,0.168,1.558
c-0.146-0.27-0.113-0.75-0.127-1.058c-0.022-0.502-0.041-0.982-0.115-1.47c-0.114-0.743-0.188-1.564-0.25-2.324
c-0.152-1.877,2.054-3.17,3.301-1.469c0.884,1.206,0.773,2.643,0.773,4.085c0,0.698-0.034,1.251-0.22,1.91
c-0.13,0.459-0.293,1.222-0.239,1.639c0-0.902,0.334-1.697,0.334-2.589c0-0.678-0.272-2.099,0.581-2.334
c1.065-0.294,2.008,0.875,2.428,1.66c0.458,0.855,0.555,1.901,0.409,2.883c-0.318,2.153-0.845,4.227-2.096,6.071
c-0.268,0.396-0.485,0.838-0.79,1.22c-0.361,0.452-0.923,0.772-1.416,1.071c-0.381,0.232-0.764,0.53-1.176,0.604
c-0.822,0.149-1.725,0.157-2.565,0.157c-1.29,0-2.564-0.068-3.832-0.251c-0.799-0.115-2.12,0.153-2.668-0.54"/>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
<!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
<!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
]>
<svg version="1.1" id="Layer_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="28.375" height="28" viewBox="0 0 28.375 28"
overflow="visible" enable-background="new 0 0 28.375 28" xml:space="preserve">
<g i:extraneous="self">
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M27.875,1.375"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M0,1.375"/>
<path fill="none" stroke="#FFFFFF" d="M0,27.475"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,27.645"/>
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,0.544"/>
<line fill="none" stroke="#FFFFFF" x1="0.875" y1="27.5" x2="27.875" y2="27.475"/>
<rect x="0.875" y="1.045" fill="#ADD8E6" width="27.125" height="26"/>
<line fill="none" stroke="#FFFFFF" x1="27.875" y1="26.925" x2="27.875" y2="0.925"/>
<line fill="none" stroke="#00008B" x1="1.375" y1="0.5" x2="27.375" y2="0.5"/>
<line fill="none" stroke="#00008B" x1="0.875" y1="1" x2="0.875" y2="27"/>
<path fill="#FFFFFF" stroke="#000000" d="M8.458,23.458c-0.473-0.168-1.02-1.269-1.363-1.695
c-0.479-0.595-0.894-1.245-1.377-1.829c-0.733-0.887-1.356-1.729-1.854-2.764c-0.375-0.782-0.884-1.997-0.005-2.648
c1.036-0.767,2.095-0.161,2.934,0.479c0.844,0.646,1.729,1.18,2.526,1.869c-0.372-0.305-0.548-0.986-0.778-1.421
c-0.253-0.477-0.565-0.906-0.822-1.375c-0.359-0.657-0.767-1.201-1.21-1.823c-0.544-0.763-1.051-1.74-0.925-2.709
c0.133-1.025,0.972-1.527,1.924-1.207c1.202,0.405,1.969,1.692,2.627,2.698c0.636,0.971,1.201,2.159,1.938,3.042
c-0.222-0.21-0.148-0.509-0.155-0.783c-0.01-0.37-0.097-0.626-0.219-0.967c-0.162-0.455-0.219-0.972-0.24-1.45
c-0.034-0.776-0.25-1.465-0.25-2.247c0-0.988-0.14-1.963,0.71-2.631c0.666-0.523,1.649-0.764,2.381-0.248
c1.385,0.976,1.057,2.999,1.209,4.458c0.079,0.759,0.165,1.489,0.2,2.263c0.022,0.496,0.209,1.068,0.168,1.558
c-0.146-0.27-0.113-0.75-0.127-1.058c-0.022-0.502-0.041-0.982-0.115-1.47c-0.114-0.743-0.188-1.564-0.25-2.324
c-0.152-1.877,2.054-3.17,3.301-1.469c0.884,1.206,0.773,2.643,0.773,4.085c0,0.698-0.034,1.251-0.22,1.91
c-0.13,0.459-0.293,1.222-0.239,1.639c0-0.902,0.334-1.697,0.334-2.589c0-0.678-0.272-2.099,0.581-2.334
c1.065-0.294,2.008,0.875,2.428,1.66c0.458,0.855,0.555,1.901,0.409,2.883c-0.318,2.153-0.845,4.227-2.096,6.071
c-0.268,0.396-0.485,0.838-0.79,1.22c-0.361,0.452-0.923,0.772-1.416,1.071c-0.381,0.232-0.764,0.53-1.176,0.604
c-0.822,0.149-1.725,0.157-2.565,0.157c-1.29,0-2.564-0.068-3.832-0.251c-0.799-0.115-2.12,0.153-2.668-0.54"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

39
build/docs.sh Executable file
View File

@@ -0,0 +1,39 @@
#!/bin/sh
rm ../doc/reference.html
CLASSES="Map Layer Layer.HTTPRequest Layer.Grid Layer.WMS Layer.KaMap Layer.EventPane Layer.Google Layer.VirtualEarth Layer.Markers Layer.Text Layer.GeoRSS Layer.Boxes Icon Marker Marker.Box Tile Tile.Image Tile.WFS Control Control.LayerSwitcher Control.MouseDefaults Control.MouseToolbar Control.PanZoom Control.PanZoomBar Control.Permalink Control.Scale LonLat Size Pixel Bounds Util"
echo "<html>
<head>
<title>OpenLayers Class Reference Documentation</title>
<style type='text/css'>
.type { background-color: #ddd }
td { border: black solid 1px; padding: 3px; }
table { border-collapse: collapse; margin: 5px 10px; }
.classref { margin-left: 20px; }
div.index { float:left; width: 300px; }
</style>
</head>
<body>" >> ../doc/reference.html
for i in $CLASSES; do
echo "<div class='index'><a href='#OpenLayers.$i'>OpenLayers.$i</a></div>" >> ../doc/reference.html
done
echo "<br style='clear:both' />" >> ../doc/reference.html
for i in $CLASSES; do
cat ../doc/$i.txt | \
perl -pe 's!^(.*?) -- (.*?) -- (.*?)$! <tr><td>$1</td><td>$2</td><td>$3</td></tr>!g;
s!^( \* )?(.*?) -- (.*?)$! <tr><td>$2</td><td>$3</td></tr>!g;
s!^ \* (.*)$! </table>\n\n<h3>$1</h3>\n <table>!;
s!{OpenLayers.(.*?)\|(.*?)}!<a href="#OpenLayers.$1" title="OpenLayers.$1">\2</a>!g;
s!{OpenLayers.(.*?)}!<a href="#OpenLayers.$1" title="OpenLayers.$1">OpenLayers.$1</a>!;
s!{([A-Za-z]+?)\|(.+?)}!<span class="type" title="$1">\2<\/span>!g;
s!{([A-Za-z]+?)}!<span class="type" title="$1">$1<\/span>!g;
s!^\* (.*)$!</table>\n<h2>$1</h2>\n<table>!;
s!^OpenLayers\.(.*)$!<h1><a name="OpenLayers.$1">OpenLayers.$1</a></h1><div class="classref">!' \
>> ../doc/reference.html
echo '</table></div>' >> ../doc/reference.html
done
echo " </body>
</html>" >> ../doc/reference.html

View File

@@ -7,9 +7,5 @@ OpenLayers.js
[last]
[exclude]
OpenLayers/Layer/KaMap.js
OpenLayers/Layer/Google.js
OpenLayers/Layer/Yahoo.js
OpenLayers/Layer/VirtualEarth.js
OpenLayers/Layer/WMS/Untiled.js
OpenLayers/Control/KeyboardDefaults.js

9
doc/Ajax.txt Normal file
View File

@@ -0,0 +1,9 @@
OpenLayers contains a number of helper functions for working with AJAX.
* Methods
OpenLayers.loadURL({String|uri}, {String|params}, {Object|caller}, {function|onComplete}, {function|onFailure}) -- none -- This function sends an XMLHTTPRequest to a remote site, specified by URI, with the params string given as the params argument. Caller is bound as 'this' to the function specified by either onComplete or onFailure.
OpenLayers.parseXMLString({String|text}) -- {AJAXResponse} -- Accepts a block of text, and creates a DOM response document from the text.
* Parameters
OpenLayers.ProxyHost -- When initiating an AJAX request, any URL that is absolute is prefixed with OpenLayers.ProxyHost. The ProxyHost is designed to accept a URL and return the content, in an effort to work around cross-browser security restrictions. This defaults to null, but if you wish to access content from another domain that Javascript would restrict access to, you must set this to be the URL which will accept a URL encoded version of the passed URL and return the content at that URL. An example is available as proxy.txt in the examples/ directory.

21
doc/Bounds.txt Normal file
View File

@@ -0,0 +1,21 @@
OpenLayers.Bounds
This class represents a bounding box. Data stores as left, bottom, right, top floats.
* Constructor
OpenLayers.Bounds(left, bottom, right, top) -- Create new Bounds.
* Methods
clone() -- {OpenLayers.Bounds} -- Return copy of the current bounds.
toString() -- {String} -- Return bounds as string.
toBBOX() -- {String} -- Return bounds as simple string, usable for WMS.
getWidth() -- {float} -- Return width of bounds.
getHeight() -- {float} -- Return height of bounds.
getSize() -- {OpenLayers.Size} -- Return size of bounds.
getCenterPixel() -- {OpenLayers.Pixel} -- Return center of bounds as pixel.
getCenterLonLat() -- {OpenLayers.LonLat} -- Return center of bounds as LonLat.
equals({OpenLayers.Bounds|bounds}) -- {Boolean} -- whether or not the bounds are equivilant.
add({float|x}, {float|y}) -- {OpenLayers.Bounds} -- Shift bounds by x and y.
contains({float|x}, {float|y}, {Boolean|inclusive}) -- {Boolean} -- Return Whether or not the passed-in coordinates are within this bounds
containsBounds({OpenLayers.Bounds|bounds}, {Boolean|partial}, {Boolean|inclusive}) -- {Boolean} -- Returns whether or not the passed-in OpenLayers.Bounds object is contained within this bounds. partial indicates whether bounds must be contained or only overlap. Inclusive determines whether border is included.
determineQuadrant({OpenLayers.LonLat|lonlat}) -- {String} -- Determine which quadrant the LonLat is in. Returns combination of "b" or "t" and "l" or "r".

View File

@@ -0,0 +1,14 @@
OpenLayers.Control.LayerSwitcher
This control will by default display a small image in the upper right corner of the map. When clicked, this image expands into a control which allows one to select between multiple types of layers, seperated into two types: Base Layers and Overlays. Only one base layer can be selected at a time, and is enforced by a radio button control being used. Multiple overlays can be selected at once, and a checkbox control is visible for this functionality.
* Constructor
OpenLayers.Control.LayerSwitcher({Object|options}?) -- Creates a new control.
* Methods
maximizeControl() -- none -- Expand the layer switcher control.
minimizeControl() -- none -- Close the layer switcher control.
* Parameters
position -- (inherited from {OpenLayers.Control}) {OpenLayers.Pixel} to use as the top-left corner of the control div, relative to the map area.
activeColor -- The color to use for the background of the layer switcher div.

View File

@@ -0,0 +1,19 @@
OpenLayers.Control.MouseDefaults
Control to set up mouse handling. This includes clicks, double clicks, scrollwheel events, and mouse movement. There are a number of functions which act as the default handlers for these events: if you wish to create your own mouse control which behaves differently, you should create a subclass of MouseDefaults, replacing the functions whose behavior you wish to change.
* Constructor
OpenLayers.Control() -- Creates a new control. No options available.
* Methods
defaultClick -- none -- This event takes place when a click event occurs on the map.
defaultDblClick -- none -- This event re-centers the map on the clicked location.
defaultMouseDown -- none -- This event starts a dragging event, so that the map can be dragged. If the shift key is held, it starts a 'zoombox' or rubber-band-zoom action instead.
defaultMouseMove -- none -- If a mouseDrag is in operation, this function causes the map to move to follow the cursor. If a zoombox is in place, this increases the size of the zoombox element to match the cursor.
defaultMouseUp -- none -- This function is called when a mouseup event is received, and either sets the center of the map to be the final location or zooms to the zoombox if enabled.
defaultMouseOut -- none -- This calls defaultMouseUp, so that when you mouse out of the map div, the events are stopped.
defaultWheelUp -- none -- Zooms in one level. Called by onWheelEvent
defaultWheelDown -- none -- Zooms out one level. Called by onWheelEvent.
onWheelEvent -- none -- catches the map wheel event, and handles it, zooming appropriately.

View File

@@ -0,0 +1,15 @@
OpenLayers.Control.MouseToolbar
Control to set up mouse handling. This includes clicks, double clicks, scrollwheel events, and mouse movement. There are a number of functions which act as the default handlers for these events: if you wish to create your own mouse control which behaves differently, you should create a subclass of MouseToolbar, replacing the functions whose behavior you wish to change. Additionally, a toolbar of images can be clicked to start events, as well as using the keyboard shortcuts. Note that if you wish to use the MouseToolbar, you *must* add a 'controls' option to the map constructor, otherwise you will have both MouseDefaults and MouseToolbar on the map, which will not work.
* Constructor
OpenLayers.Control.MouseToolbar({OpenLayers.Pixel|position}, {String|direction}) -- Creates a new control. The direction of the control can be either "vertical" or "horizontal". The default is vertical.
* Methods
defaultClick -- none -- This event takes place when a click event occurs on the map.
defaultDblClick -- none -- This event re-centers the map on the clicked location.
defaultMouseDown -- none -- This event starts a dragging event, so that the map can be dragged. If the shift key is held, it starts a 'zoombox' or rubber-band-zoom action instead.
defaultMouseMove -- none -- If a mouseDrag is in operation, this function causes the map to move to follow the cursor. If a zoombox is in place, this increases the size of the zoombox element to match the cursor.
defaultMouseUp -- none -- This function is called when a mouseup event is received, and either sets the center of the map to be the final location or zooms to the zoombox if enabled.
defaultMouseOut -- none -- This calls defaultMouseUp, so that when you mouse out of the map div, the events are stopped.

9
doc/Control.PanZoom.txt Normal file
View File

@@ -0,0 +1,9 @@
OpenLayers.Control.PanZoom
Creates a small toolset for controlling the location of the map with panning and zooming, including four directional arrows, a zoom in and zoom out, and one button which zooms to the max extent of the map.
* Constructor
OpenLayers.Control.PanZoom({Object|options}) -- Creates a new panzoom control.
* Parameters
slideFactor -- Number of pixels by which to slide the map when a pan arrow is clicked.

View File

@@ -0,0 +1,6 @@
OpenLayers.Control.PanZoom
Creates a small toolset for controlling the location of the map with panning and zooming, including four directional arrows, a zoom in and zoom out, and a bar on which a slider can be moved to zoom in or out by multiple stops at once.
* Constructor
OpenLayers.Control.PanZoomBar() -- Creates a new panzoombar control.

View File

@@ -0,0 +1,6 @@
OpenLayers.Control.Permalink
A small control which updates a "Permalink" to the map every time the viewport changes. This allows users to copy a link to a specfic map view. By default, it places itself in the lower right corner of the map. This control must be added to the map after a baselayer has been set.
* Constructor
OpenLayers.Control.Scale({DOMElement|element}?, {String|base}) -- Creates a new permalink control. The DOMElement is used, if passed, as the element on which the 'href' is set. If you prefer to put this link on an element outside of the map, set this element to an anchor element to have its href updated when the map moves. If you wish to make the link go to some other URL (for example, an editing interface rather than the current URL), the 'base' property can be used, to which the ?lat=&lon=&zoom= will be appended after the map has moved.

6
doc/Control.Scale.txt Normal file
View File

@@ -0,0 +1,6 @@
OpenLayers.Control.Scale
A small control which displays an informative scale value, a la "1:50K" , by defualt in the lower right of the map viewport.
* Constructor
OpenLayers.Control.Scale({DOMElement|element}?) -- Creates a new scale control. The DOMElement is used, if passed, to put the scale inside -- this allows you to have the scale displayed in some location outside the map.

9
doc/Control.txt Normal file
View File

@@ -0,0 +1,9 @@
OpenLayers.Control
Base class from which controls are derived. Controls are elements of the map used to control things like zoom, layer status, or to provide information to the user about the status of the map, such as scale or copyright information.
* Constructor
OpenLayers.Control({Object|options}?) -- Creates a new control. The options here are used to control parameters of the control. The base control defines only "position", which is designed to be an {OpenLayers.Pixel} which is the top-left of the location of the control relative to the map div.
* Parameters
position -- {OpenLayers.Pixel} to use as the top-left corner of the control div, relative to the map area.

9
doc/Icon.txt Normal file
View File

@@ -0,0 +1,9 @@
OpenLayers.Icon
Icon is used as the visual representation of a Marker. Creating such a representation requres up to three parts: An Icon URL, a size, and an offset. The icon URL is a pointer to an image to use as an icon. The size is the size of the image, as an {OpenLayers.Size} object, and the offset is the position of the top left corner of the image in pixels, relative to the latitude and longitude of the Marker.
* Constructor
OpenLayers.Icon({String|url}, {OpenLayers.Size|size}, {OpenLayers.Pixel|offset}) -- creates a new icon.
* Methods
clone() -- {OpenLayers.Icon} -- Create an exact copy of the icon.

7
doc/Layer.Boxes.txt Normal file
View File

@@ -0,0 +1,7 @@
OpenLayers.Layer.Boxes
A subclass of the markers layer, this layer draws boxes using div elements
instead of icons using images.
* Constructor
OpenLayers.Layer.Boxes(name, options) -- Same as OpenLayers.Layer.Markers.

6
doc/Layer.EventPane.txt Normal file
View File

@@ -0,0 +1,6 @@
OpenLayers.Layer.EventPane
Designed to act as a super-class for layers which need OpenLayers to intercept click events. Google Maps and Microsoft Virtual Earth both use this functionality, in order to allow for actions like the rubber-band-zoom/zoombox functionality. This Layer is not designed to be used on its own, but instead to act as an intermediary between the user and layers which have their own click handlers.
* Constructor
OpenLayers.Layer.EventPane(name, options) -- Only designed to be used by subclasses.

12
doc/Layer.GeoRSS.txt Normal file
View File

@@ -0,0 +1,12 @@
OpenLayers.Layer.GeoRSS
GeoRSS layer. Pass a name and location of a GeoRSS file on the web, and a marker will be added to the map for each item in the GeoRSS feed. Uses OpenLayers.loadURL to load the XML, parses the data, and adds markers to the map. The GeoRSS layer supports 1.0 and 2.0 in IE and Firefox, and supports 2.0 in Safari. (Ticket #111 explains the reason for this difference.)
* Constructor
OpenLayers.Layer.GeoRSS(name, url) -- Name and location of GeoRSS XML file.
* Methods
parseData(ajaxResponse) -- none -- Callback for the loadURL call. This function parses the XML for the GeoRSS feed, creating markers for the data and adding a popup to each marker. It populates an array of features as 'this.features'.
markerClick(Event) -- none -- Action to perform when a marker is clicked.
clearFeatures() -- none -- Removes all features and markers from the map.

16
doc/Layer.Google.txt Normal file
View File

@@ -0,0 +1,16 @@
OpenLayers.Layer.Google
The Google Layer in OpenLayers allows you to include Google Maps functionality in your OpenLayers maps. In order to use the Google Layer, you must first obtain an API key for Google Maps, and include the Google Maps API script in your page. Once you have done this,
* Constructor
OpenLayers.Layer.Google(name, options?) -- Constructor for Google layer. Accepts name and options.
* Methods
getOLLonLatFromGLatLng(GLonLat) -- {OpenLayers.LonLat} -- Convert from GLatLon to OpenLayers LonLat
getGLatLngFromOLLonLat({OpenLayers.LonLat|lonlat}) -- GLatLon -- Convert From OpenLayers LonLat to GLatLon
getOLPixelFromGPoint(GPoint) -- {OpenLayers.Pixel} -- Convert from GPoint to OpenLayers.Pixel
getGPointFromOLPixel({OpenLayers.Pixel|pixel}) -- GPoint -- Create GPoint from OpenLayers Pixel.
* Parameters
type -- one of G_MAP, G_SATELLITE_MAP, G_HYBRID_MAP, used to choose the type of map to display.

31
doc/Layer.Grid.txt Normal file
View File

@@ -0,0 +1,31 @@
OpenLayers.Layer.Grid
The Grid layer is the base layer for almost all image layers. This is a subclass of HTTPRequest.
* Constructor
OpenLayers.Layer.Grid(name, url, params, options) -- URL is the base URL to the layer. Params is a set of params to be included in the HTTP Request. Options is a set of options, extending the parameters of the layer.
* Methods
getGridBounds() -- {OpenLayers.Bounds} -- return geographic extent of the grid of tiles.
_initTiles() -- none -- Used to initialize the tile grid, creating image elements as neccesary and filling them with the correct images.
spiralTileLoad() -- none -- Called from _initTiles. Rotates through the grid filling in the images for the grid.
clone() -- {OpenLayers.Layer.Grid} -- create a clone of the layer. Subclassed from {OpenLayers.Layer}.
setMap(map) -- none -- Set the map property of the layer. Also set the parameters which are inherited from the map. This is also where the tileSize is retrieved from the map. Subclassed from {OpenLayers.Layer}.
moveTo({OpenLayers.Bounds|bounds}, {Boolean|zoomChanged}) -- none -- Not implemented here, but the general function called on dragging or setCenter, to move the Layer to a new geographic location. Subclassed from {OpenLayers.Layer}.
getResolution() -- {float} -- Return the current resolution of the map, in units/pixel. Subclassed from {OpenLayers.Layer}.
getExtent() -- {OpenLayers.Bounds} -- Return the geographic extent of the current map viewport. Subclassed from {OpenLayers.Layer}.
getZoomForExtent({OpenLayers.Bounds|bounds}) -- {Integer} -- return the integer zoom which most closely matches the passed bounds. Subclassed from {OpenLayers.Layer}.
getLonLatFromViewPortPx({OpenLayers.Pixel|pixel}) -- {OpenLayers.LonLat} -- Returns an OpenLayers.LonLat which is the passed-in view port OpenLayers.Pixel, translated into lon/lat by the layer. Subclassed from {OpenLayers.Layer}.
getViewPortPxFromLonLat({OpenLayers.LonLat|lonlat}) -- {OpenLayers.Pixel} -- Returns An OpenLayers.Pixel which is the passed-in OpenLayers.LonLat, translated into view port pixels. Subclassed from {OpenLayers.Layer}.
* Parameters
buffer -- Default 2. Number of tiles around the central map area which OpenLayers will preload so that dragging goes more smoothly.
* Subclassed from OpenLayers.Layer
isBaseLayer -- This determines whether the layer is a base layer or an overlay. Only one Base Layer can be displayed on the map at once. Default is false.
projection -- SRS string to describe the layer. If this is set on the map before the Layer is added to the map, it will inherit from the map.
maxExtent -- an OpenLayers.Bounds for the layer. This is the maximum geographic extent of the layer. If this is set on the map before the Layer is added to the map, it will inherit from the map.
maxResolution -- The number of degrees per pixel at zoom level 0. If this is set on the map before the Layer is added to the map, it will inherit from the map.
maxZoomLevel -- The maximum zoom level for the layer. If this is set on the map before the Layer is added to the map, it will inherit from the map.
minScale -- The scale at zoom level 0. If this is set on the map before the Layer is added to the map, it will inherit from the map.
maxScale -- The scale at the highest zoom level. If this is set on the map before the Layer is added to the map, it will inherit from the map.
units -- The units the map is projected into. If this is set on the map before the Layer is added to the map, it will inherit from the map.

11
doc/Layer.HTTPRequest.txt Normal file
View File

@@ -0,0 +1,11 @@
OpenLayers.Layer.HTTPRequest
Sublass of Layer used for services which require initiating multiple HTTPRequests.
* Constructor
OpenLayers.Layer.HTTPRequest(name, url, params, options) -- URL is the base URL to the layer. Params is a set of params to be included in the HTTP Request. Options is a set of options, extending the parameters of the layer.
* Methods
initResolutions() -- none -- Based on the current minScale/maxScale/maxResolution/maxZoomLevels/scales/resolutions parameters, initializes an array of 'zoom levels' as this.resolutions, which are then used as an index into when zooming.
getFullRequestString(newParams) -- {String} -- Returns the full request string for a combination of the defaults on this layer and the parameters passed via newParams.

7
doc/Layer.KaMap.txt Normal file
View File

@@ -0,0 +1,7 @@
OpenLayers.Layer.KaMap
ka-Map is a Mapserver wrapper which performs caching and works around many of the deficiencies with tiling when using Mapserver as a WMS client.
* Construtor
OpenLayers.Layer.KaMap(name, url, params, options) -- URL is the url of the tile.php for KaMap.

13
doc/Layer.Markers.txt Normal file
View File

@@ -0,0 +1,13 @@
OpenLayers.Layer.Markers
The base class for all vector drawing, The OpenLayers.Layer.Markers layer is the primary way to get annotations into your map.
* Constructor
OpenLayers.Layer.Markers(name, options) -- Name and options for layer.
* Methods
addMarker({OpenLayers.Marker|Marker}) -- none -- Adds a marker to the layer, sets the map object on the marker, and calls drawMarker on the marker.
removeMarker({OpenLayers.Marker|Marker}) -- none -- Remove the marker from the layer and map.
clearMarkers() -- none -- Remove all markers from the layer with removeMarker.
redraw() -- none -- Redraw all markers. Used so that markers can change their position when a base layer changes.
drawMarker -- none -- Call marker.draw(px), which passes the Pixel of the latitude/longitude in the map viewport to the marker. adds the marker to the div, and marks the marker as drawn.

10
doc/Layer.Text.txt Normal file
View File

@@ -0,0 +1,10 @@
OpenLayers.Layer.Text
Subclass of Markers layer which retrieves CSV file from the web, and parses content to create markers and popups.
* Constructor
OpenLayers.Layer.Text(name, options) -- Pass in name, and set location: 'URL of CSV file' in the options hash.
* Methods
parseData(ajaxRequest) -- none -- Parses returned CSV file.

View File

@@ -0,0 +1,14 @@
OpenLayers.Layer.VirtualEarth
The Virtual Earth Layer in OpenLayers allows you to include Virtual Earth Maps in your OpenLayers maps. In order to use the Virtual Earth Layer, you must first include the Virtual Earth API script in your page. Once you have done this, simply add the layer to your map.
* Constructor
OpenLayers.Layer.VirtualEarth(name) -- Constructor for Virtual Earth layer. Accepts name.
* Methods
getOLLonLatFromVELatLng(VELatLon) -- {OpenLayers.LonLat} -- Convert from VELatLon to OpenLayers LonLat
getVELatLngFromOLLonLat({OpenLayers.LonLat|lonlat}) -- VELatLon -- Convert From OpenLayers LonLat to VELatLon
getOLPixelFromVEPoint(Msn.VE.Pixel) -- {OpenLayers.Pixel} -- Convert from VEPoint to OpenLayers.Pixel
getGPointFromOLPixel({OpenLayers.Pixel|pixel}) -- Msn.VE.Pixel -- Create Msvn.VE.Pixel from OpenLayers Pixel.

15
doc/Layer.WMS.txt Normal file
View File

@@ -0,0 +1,15 @@
OpenLayers.Layer.WMS
The WMS layer allows one to connect to a WMS server to obtain images. Params are available as a hash on the layer object, however, all keys are upper-cased automatically for maximum compatibility with WMS servers, so a parameter which is set as 'layers' will be uppercased to LAYERS. Where 'layer' is your Javscript variable for the layer, layer.params.LAYERS is the value of the layers param as set by the constructor.
If you wish to change params, you should use mergeNewParams, rather than accessing the parameters directly.
* Constructor
OpenLayers.Layer.WMS(name, url, params, options) -- URL is the base URL to the layer. Params is a set of params to be included in the HTTP Request. Options is a set of options, extending the parameters of the layer.
* Methods
getURL({OpenLayers.Bounds|bounds}) -- {String} -- Returns a WMS URL for the given bounds based on the properties of the layer.
All other methods are inherited from {OpenLayers.Layer.Grid}
* Options
isBaseLayer -- WMS layers default to being base layers unless one of their parameters is 'transparent':'true'.

38
doc/Layer.txt Normal file
View File

@@ -0,0 +1,38 @@
OpenLayers.Layer
Layers are the most important and central aspect of OpenLayers. They are the
core functionality for the software: Everything that ends up on the map comes
from a layer. The base layer class is designed to be subclassed by any number
of different layers.
* Constructor
OpenLayers.Layer(name, options) -- All layers have a name as their first param. This name is used to display the layer in the LayerSwitcher, and for other purposes. The options parameter is used to replace any parameters of the Layer which need to be different.
* Methods
clone() -- {OpenLayers.Layer} -- create a clone of the layer.
setName({String|name}) -- none -- Set the name of the layer to something different.
moveTo({OpenLayers.Bounds|bounds}, {Boolean|zoomChanged}) -- none -- Not implemented here, but the general function called on dragging or setCenter, to move the Layer to a new geographic location.
reproject() -- none -- Subclassed by vector layers to redraw vectors when base layer changes.
setMap(map) -- none -- Set the map property of the layer. Also set the parameters which are inherited from the map.
getVisibility() -- {Boolean} -- Return true or false based on visibility of the layer.
setVisibility({Boolean|visible}) -- none -- Set the layer visibility, and trigger the appropriate events.
getResolution() -- {float} -- Return the current resolution of the map, in units/pixel.
getExtent() -- {OpenLayers.Bounds} -- Return the geographic extent of the current map viewport.
getZoomForExtent({OpenLayers.Bounds|bounds}) -- {Integer} -- return the integer zoom which most closely matches the passed bounds.
getLonLatFromViewPortPx({OpenLayers.Pixel|pixel}) -- {OpenLayers.LonLat} -- Returns an OpenLayers.LonLat which is the passed-in view port OpenLayers.Pixel, translated into lon/lat by the laye
getViewPortPxFromLonLat({OpenLayers.LonLat|lonlat}) -- {OpenLayers.Pixel} -- Returns An OpenLayers.Pixel which is the passed-in OpenLayers.LonLat, translated into view port pixels
* Parameters
isBaseLayer -- This determines whether the layer is a base layer or an overlay. Only one Base Layer can be displayed on the map at once. Default is false.
projection -- SRS string to describe the layer. If this is set on the map before the Layer is added to the map, it will inherit from the map.
maxExtent -- an OpenLayers.Bounds for the layer. This is the maximum geographic extent of the layer. If this is set on the map before the Layer is added to the map, it will inherit from the map.
maxResolution -- The number of degrees per pixel at zoom level 0. If this is set on the map before the Layer is added to the map, it will inherit from the map.
maxZoomLevel -- The maximum zoom level for the layer. If this is set on the map before the Layer is added to the map, it will inherit from the map.
minScale -- The scale at zoom level 0. If this is set on the map before the Layer is added to the map, it will inherit from the map.
maxScale -- The scale at the highest zoom level. If this is set on the map before the Layer is added to the map, it will inherit from the map.
units -- The units the map is projected into. If this is set on the map before the Layer is added to the map, it will inherit from the map.

13
doc/LonLat.txt Normal file
View File

@@ -0,0 +1,13 @@
OpenLayers.LonLat
This class represents a geographic coordinate pair, either projected or unprojected.
* Constructor
OpenLayers.LonLat({float|lon}, {float|lat}) -- Create LonLat.
* Methods
toString() -- {String} -- Converts to human readable string.
toShortString() -- {String} -- Converts to short human readable string.
clone() -- {OpenLayers.Size} -- Returns a copy of the pixel.
equals({OpenLayers.LonLat|ll}) -- {Boolean} -- Compares two LonLats.
add({int|lon}, {int|lat}) -- {OpenLayers.LonLat} -- add x and y to the current coordinates.

75
doc/Map.txt Normal file
View File

@@ -0,0 +1,75 @@
OpenLayers.Map
Instantiate class {OpenLayers.Map} in order to create a map. This is the central class in the API. Everything else is auxiliary.
* Constructor
OpenLayers.Map(container, opts?) -- Creates a new map inside of the given HTML container, which is typically a DIV element. The opts variable is an object with various options, as described in the options section below.
* Methods
* Layer Management
addLayer({OpenLayers.Layer|layer}) -- none -- adds a layer to the list currently set for the map.
addLayers([ {OpenLayers.Layer|layer}, {OpenLayers.Layer|layer} ]) -- none -- Adds multiple layers to a map.
removeLayer({OpenLayers.Layer|layer}) -- none -- Remove a layer from the map.
setBaseLayer({OpenLayers.Layer|layer}) -- none -- Sets a new base layer for the map. The provided layer should have already been added to the map. Changing the base layer causes all other base layers to be turned off, and all overlays to reproject themselves.
* Control Management
addControl({OpenLayers.Control|control}) -- none -- Adds a control to the map.
* Popup Management
addPopup({OpenLayers.Popup|popup}, {Boolean|exclusive}) -- none -- adds a popup to the map. If exclusive is set to true, then all other popups are closed first.
removePopup({OpenLayers.Popup|popup}) -- none -- removes an existing popup from the map.
* Center management
setCenter({OpenLayers.LonLat|lonlat}, {int|zoom}) -- none -- Set the center point of the map. This then moves all the layers to the new center location as well, using each layer's 'moveTo' function. The 'zoom' is an integer from 0 to maxZoomLevel.
pan({Integer|dx}, {Integer|dy}) -- none -- Allows user to pan by a value of screen pixels
* Zoom Management
zoomTo({int|zoom}) -- none -- zoom to the given zoom level.
zoomIn() -- none -- zoom in one level.
zoomOut() -- none -- zoom out one level.
zoomToExtent({OpenLayers.Bounds|bounds}) -- none -- Set the map such that the bounds fits within the current viewport area.
zoomToMaxExtent() -- none -- Zoom such that the entire bounds of the map is contained in the viewport.
zoomToScale({float}) -- none -- Zoom as close to the given scale as possible. Scale can be given as a ratio (1/24000) or as the denominator of the scale value (24000). zoomToScale will find the zoom level which most closely fits the requested scale and set that as the current zoom level.
* Current Map Information
getLonLatFromPixel({OpenLayers.Pixel|pixel}) -- {OpenLayers.LonLat} -- Returns OpenLayers.LonLat corresponding to the given OpenLayers.Pixel, translated into lon/lat by the current base layer
getPixelFromLonLat({OpenLayers.LonLat|lonlat}) -- {OpenLayers.Pixel} -- Returns OpenLayers.Pixel corresponding to the given OpenLayers.LonLat, translated by the current base layer
getCenter() -- {OpenLayers.LonLat} -- Returns a LonLat for the current center of the map
getZoom() -- {Integer} -- Returns the current zoom level as an integer
getExtent() -- {OpenLayers.Bounds} -- Returns a Bounds object which represents the geographic bounds of the current viewPort.
getSize() -- {OpenLayers.Pixel} -- Returns the pixel size of the current map window.
getTileSize() -- {OpenLayers.Size} -- Returns tile size currently set for map.
getResolution() -- {float} -- Returns the current resolution (units/pixel) of the map
getZoomForExtent({OpenLayers.Bounds|bounds}) -- Zoom level in which the given bounds will fit -- zooming to this level and setting the center of the map in the center of the bounds will always fit the given bounds in the map.
* Default Map Information
getMaxResolution() -- {float} -- returns The Map's Maximum Resolution, the units/pixel at zoom level 0. The default is 1.40625, to match the approximate MaxResolution used by the commercial providers.
getMaxExtent() -- {OpenLayers.Bounds} -- Return the max extent of the current base layer as defined on the layer. The default maxExtent for OpenLayers is -180,-90,180,90
getMaxZoomLevel() -- {int} -- Returns the maximum zoom level that can be reached in the map for the current base layer
getMinZoomLevel() -- {int} -- Returns the minimum zoom level that can be reached in the map for the current base layer
* Events
addlayer -- a layer is added to the map
removelayer -- a layer is removed from the map
changelayer -- a layer has some property of it, typically visibility, changed.
changebaselayer -- the current base layer changes
movestart -- start of a movement in the map
zoomend -- end of a zoom action
mouseover -- map is moused over
mouseout -- map is no longer mousedout
mousemove -- mouse moves inside map
dragstart -- drag action starts
dragend -- drag action ends
* Options:
* controls -- an array of control objects to be added to the map. The default is [new OpenLayers.Control.MouseDefaults(), new OpenLayers.Control.PanZoom()]
* projection -- used by WMS layers, should be an SRS identifier.
* maxZoomLevel -- The number of zoom levels to use in the map.
* maxExtent -- {OpenLayers.Bounds} to be used as the maximum extent of a map. The center of the map can not leave the maxExtent of the map when dragging.
* maxResolution -- The units/pixel measurement at zoom level 0. Default is 1.40625
* resolutions -- An array of resolutions to be used as an index when zooming. Overrides maxZoomLevel and maxResolution if present.
* minScale -- The smallest scale value. minScale is preferred over maxResolution, if present.
* maxScale -- The maximum scale the map should include. Overrides maxZoomLevel if present.
* units -- The units of the map. Defaults to degrees. Neccesary when using scale in any way.
* scales -- An array of scale values. Overrides maxResolution, maxZoomLevel, resolutions, and min/max scale if present.

10
doc/Marker.Box.txt Normal file
View File

@@ -0,0 +1,10 @@
OpenLayers.Marker.Box
A different kind of Marker, designed to be added to a Boxes layer instead of a Markers layer.
* Constructor
OpenLayers.Marker.Box({OpenLayers.Bounds|bounds}, borderColor, borderWidth) -- Set up a box. Defaults are red, with a width of 2.
* Methods
setBorder(color, width) -- sets properties of border color and width.

15
doc/Marker.txt Normal file
View File

@@ -0,0 +1,15 @@
OpenLayers.Marker
Instantiate class {OpenLayers.Marker} in order to create a marker.
* Constructor
OpenLayers.Marker({OpenLayers.LonLat|lonlat}, {OpenLayers.Icon|icon}? ) -- Creates a new marker object. This object must be added to a Marker layer and will then be displayed. The icon can be left null -- if this is the case, then the default OpenLayers icon will be used.
* Methods
onScreen() -- {boolean} -- Returns whether or not the marker is currently visible on screen.
inflate({float}) -- none -- Changes the size of the Icon by a factor of the passed float.
display({string}) -- none -- Sets the style.display property of the Icon.
* Events
Standard browser events are available.

13
doc/Pixel.txt Normal file
View File

@@ -0,0 +1,13 @@
OpenLayers.Pixel
This class represents a screen coordinate in x and y coordinates.
* Constructor
OpenLayers.Pixel({float|x}, {float|y}) -- Create Pixel.
* Methods
toString() -- {String} -- Converts to human readable string.
clone() -- {OpenLayers.Pixel} -- Returns a copy of the pixel.
equals({OpenLayers.Pixel|px}) -- {Boolean} -- Tests for equivilance.
add({int|x}, {int|y}) -- {OpenLayers.Pixel} -- add x and y to the current coordinates.
offset({OpenLayers.Pixel|pixel}) -- {OpenLayers.Pixel} -- Add pixels together.

11
doc/Size.txt Normal file
View File

@@ -0,0 +1,11 @@
OpenLayers.Size
This class represents a width/height pair.
* Constructor
OpenLayers.Size({float|h}, {float|w}) -- Create Size.
* Methods
toString() -- {String} -- Converts to human readable string.
clone() -- {OpenLayers.Size} -- Returns a copy of the pixel.
add({int|x}, {int|y}) -- {OpenLayers.Size} -- add x and y to the current coordinates.

7
doc/Tile.Image.txt Normal file
View File

@@ -0,0 +1,7 @@
OpenLayers.Tile.Image
The image tile is designed to hold images for all types of layers, from WMS to KaMap to WorldWind.
* Constructor
OpenLayers.Tile.Image({OpenLayers.Layer|layer}, {OpenLayers.Pixel|position}, {OpenLayers.Bounds|bounds}, {String|url}, {OpenLayers.Size|size}) -- Create a new tile, with properties passed.

6
doc/Tile.WFS.txt Normal file
View File

@@ -0,0 +1,6 @@
OpenLayers.Tile.WFS
The WFS tile allows you to load any number of WFS URLs into a single tile.
* Constructor
OpenLayers.Tile.WFS({OpenLayers.Layer|layer}, {OpenLayers.Pixel|position}, {OpenLayers.Bounds|bounds}, {String|urls}, {OpenLayers.Size|size}) -- Create a new tile, with properties passed. The major difference between this tile and other tiles is what it does with results: The WFS tile is designed to parse XML responses, and create features for each item in the response.

10
doc/Tile.txt Normal file
View File

@@ -0,0 +1,10 @@
OpenLayers.Tile
This is a class designed to designate a single tile, however
it is explicitly designed to do relatively little. Tiles store information
about themselves -- such as the URL that they are related to, and their
size - but do not add themselves to the layer div automatically, for
example.
* Constructor
OpenLayers.Tile({OpenLayers.Layer|layer}, {OpenLayers.Pixel|position}, {OpenLayers.Bounds|bounds}, {String|url}, {OpenLayers.Size|size}) -- Create a new tile, with properties passed.

7
doc/Util.txt Normal file
View File

@@ -0,0 +1,7 @@
OpenLayers.Util
Utility class. Stores a bunch of methods and settings that don't fit anywhere else.
* Options
OpenLayers.Util.onImageLoadErrorColor -- A string to set img.style.backgroundColor to if the onerror event fires for the image (useful for 500 errors from WMS, for example).

View File

@@ -6,5 +6,10 @@ Philip Lindsay
John Frank
Schuyler Erle
Patch contributors
------------------
Corey Puffault
Tim Schaub
OpenLayers is graciously supported by MetaCarta, Inc.
<http://www.metacarta.com>.

79
examples/baseLayers.html Normal file
View File

@@ -0,0 +1,79 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 100%;
height: 512px;
border: 1px solid black;
background-color: blue;
}
</style>
<!-- this gmaps key generated for http://openlayers.org/dev/ -->
<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA9XNhd8q0UdwNC7YSO4YZghSPUCi5aRYVveCcVYxzezM4iaj_gxQ9t-UajFL70jfcpquH5l1IJ-Zyyw'></script>
<!-- Localhost key -->
<!-- <script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTS6gjckBmeABOGXIUiOiZObZESPg'></script>-->
<script src='http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js'></script>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
<!--
var lon = 5;
var lat = 40;
var zoom = 5;
var map, markers;
var barcelona = new OpenLayers.LonLat(2.13134765625,
41.37062534198901);
var madrid = new OpenLayers.LonLat(-3.6968994140625,
40.428314208984375);
function init(){
map = new OpenLayers.Map( $('map') );
var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0",
{layers: 'basic'} );
var google = new OpenLayers.Layer.Google( "Google Hybrid" , {type: G_HYBRID_MAP });
var ve = new OpenLayers.Layer.VirtualEarth( "VE");
map.addLayers([wms, google, ve]);
markers = new OpenLayers.Layer.Markers("markers");
map.addLayer(markers);
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
map.addControl( new OpenLayers.Control.LayerSwitcher() );
}
function add() {
var url = 'http://boston.openguides.org/markers/AQUA.png';
var sz = new OpenLayers.Size(10, 17);
var calculateOffset = function(size) {
return new OpenLayers.Pixel(-(size.w/2), -size.h);
};
var icon = new OpenLayers.Icon(url, sz, null, calculateOffset);
marker = new OpenLayers.Marker(barcelona, icon);
markers.addMarker(marker);
marker = new OpenLayers.Marker(madrid, icon.clone());
markers.addMarker(marker);
}
function remove() {
markers.removeMarker(marker);
}
// -->
</script>
</head>
<body onload="init()">
<h1>OpenLayers With WMS, Google, VE Example</h1>
<div id="map"></div>
<div style="background-color:green" onclick="add()"> click to add a marker to the map</div>
<div style="background-color:red" onclick="remove()"> click to remove the marker from the map</div>
</body>
</html>

49
examples/boxes.html Normal file
View File

@@ -0,0 +1,49 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
<!--
box_extents = [
[-10, 50, 5, 60],
[-75, 41, -71, 44],
[-122.6, 37.6, -122.3, 37.9],
[10, 10, 20, 20]
];
function init(){
var map = new OpenLayers.Map('map');
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
var boxes = new OpenLayers.Layer.Boxes( "Boxes" );
for (var i = 0; i < box_extents.length; i++) {
ext = box_extents[i];
bounds = new OpenLayers.Bounds(ext[0], ext[1], ext[2], ext[3]);
box = new OpenLayers.Marker.Box(bounds);
box.events.register("click", box, function (e) {
this.setBorder("yellow");
});
boxes.addMarker(box);
}
map.addLayers([ol_wms, boxes]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToMaxExtent();
}
// -->
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<div id="map"></div>
</body>
</html>

613
examples/canvas.html Normal file
View File

@@ -0,0 +1,613 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA9XNhd8q0UdwNC7YSO4YZghSPUCi5aRYVveCcVYxzezM4iaj_gxQ9t-UajFL70jfcpquH5l1IJ-Zyyw'></script>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
<!--
var map, canvas;
var click;
function init(){
map = new OpenLayers.Map('map');
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'});
var g = new OpenLayers.Layer.Google("Google");
canvas = new OpenLayers.Layer.Canvas("Canvas Layer");
map.addLayers([ol_wms, g,canvas]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
// map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.zoomToMaxExtent();
canvas.drawLine(new OpenLayers.LonLat(-71,42), new OpenLayers.LonLat(0,0));
canvas.setStrokeColor("red");
canvas.setStrokeWidth(5);
canvas.setAlpha(.5);
map.events.register("click", map, function(e) {
if (click) {
canvas.drawLine(click, this.getLonLatFromPixel(e.xy));
click = null;
$('status').innerHTML = "";
}
else {
click = this.getLonLatFromPixel(e.xy);
$('status').innerHTML = "Point 1 stored: "+click+". <a href='#' onclick='click=null;return false'>Reset</a>";
}
});
}
function drawIt() {
canvas.drawLine(
new OpenLayers.LonLat(parseFloat($('lon1').value), parseFloat($('lat1').value)),
new OpenLayers.LonLat(parseFloat($('lon2').value), parseFloat($('lat2').value))
);
}
// -->
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<div style="float:right">
<br />
Start Lon: <input type="text" id="lon1" />
Start Lat: <input type="text" id="lat1" /><br />
End Lon: <input type="text" id="lon2" />
End Lat: <input type="text" id="lat2" /><br />
<input type="submit" value="Add line" onclick="drawIt()" />
<div id="status"></div>
<center>
<table border="1" cellpadding="0" cellspacing="1">
<tbody>
<tr>
<td bgcolor="#000000">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#000000');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#000033">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#000033');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#000066">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#000066');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#000099">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#000099');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#0000cc">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#0000CC');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#0000ff">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#0000FF');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#330000">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#330000');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#330033">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#330033');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#330066">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#330066');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#330099">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#330099');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#3300cc">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#3300CC');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#3300ff">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#3300FF');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#660000">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#660000');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#660033">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#660033');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#660066">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#660066');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#660099">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#660099');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#6600cc">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#6600CC');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#6600ff">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#6600FF');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
</tr>
<tr>
<td bgcolor="#990000">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#990000');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#990033">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#990033');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#990066">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#990066');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#990099">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#990099');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#9900cc">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#9900CC');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#9900ff">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#9900FF');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#cc0000">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#CC0000');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#cc0033">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#CC0033');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#cc0066">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#CC0066');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#cc0099">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#CC0099');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#cc00cc">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#CC00CC');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#cc00ff">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#CC00FF');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#ff0000">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#FF0000');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#ff0033">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#FF0033');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#ff0066">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#FF0066');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#ff0099">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#FF0099');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#ff00cc">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#FF00CC');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#ff00ff">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#FF00FF');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
</tr>
<tr>
<td bgcolor="#003300">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#003300');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#003333">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#003333');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#003366">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#003366');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#003399">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#003399');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#0033cc">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#0033CC');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#0033ff">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#0033FF');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#333300">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#333300');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#333333">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#333333');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#333366">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#333366');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#333399">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#333399');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#3333cc">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#3333CC');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#3333ff">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#3333FF');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#663300">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#663300');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#663333">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#663333');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#663366">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#663366');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#663399">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#663399');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#6633cc">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#6633CC');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#6633ff">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#6633FF');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
</tr>
<tr>
<td bgcolor="#993300">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#993300');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#993333">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#993333');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#993366">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#993366');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#993399">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#993399');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#9933cc">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#9933CC');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#9933ff">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#9933FF');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#cc3300">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#CC3300');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#cc3333">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#CC3333');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#cc33cc">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#CC33CC');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#cc33ff">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#CC33FF');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#ff3300">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#FF3300');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#ff3333">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#FF3333');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#ff3366">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#FF3366');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#ff3399">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#FF3399');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#ff33cc">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#FF33CC');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#ff33ff">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#FF33FF');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
</tr>
<tr>
<td bgcolor="#006600">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#006600');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#006633">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#006633');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#006666">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#006666');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#006699">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#006699');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#0066cc">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#0066CC');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#336699">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#336699');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#3366cc">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#3366CC');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#3366ff">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#3366FF');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#666600">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#666600');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#666633">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#666633');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#666666">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#666666');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#666699">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#666699');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#6666cc">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#6666CC');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#6666ff">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#6666FF');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
</tr>
<tr>
<td bgcolor="#996600">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#996600');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#996633">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#996633');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#9966ff">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#9966FF');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#cc6600">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#CC6600');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#cc6633">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#CC6633');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#cc6666">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#CC6666');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#cc6699">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#CC6699');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#cc66cc">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#CC66CC');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#cc66ff">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#CC66FF');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#ff6600">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#FF6600');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#ff6633">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#FF6633');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
</tr>
<tr>
<td bgcolor="#009900">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#009900');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#009933">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#009933');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#009966">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#009966');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#009999">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#009999');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#0099cc">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#0099CC');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#0099ff">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#0099FF');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#339900">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#339900');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#339933">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#339933');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#339966">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#339966');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#339999">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#339999');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
<td bgcolor="#3399cc">
<font size="-3">
<a href="#" onclick="canvas.setStrokeColor('#3399CC');return false">&nbsp;&nbsp;&nbsp;</a>
</font>
</td>
</tr>
</table>
</div>
<div id="map"></div>
</body>
</html>

View File

@@ -2,8 +2,8 @@
<head>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -27,7 +27,8 @@
map.addLayers([ol_wms, jpl_wms, cie_wms]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
// map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.zoomToMaxExtent();
}
// -->
</script>

View File

@@ -2,8 +2,8 @@
<head>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -24,7 +24,8 @@
map.addLayers([ol_wms, jpl_wms]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
// map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.zoomToMaxExtent();
map.events.register("click", map, function(e) {
var lonlat = map.getLonLatFromViewPortPx(e.xy);
alert("You clicked near " + lonlat.lat + " N, " +

View File

@@ -2,8 +2,8 @@
<head>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -34,13 +34,16 @@
map.addControl(new OpenLayers.Control.PanZoomBar());
map.addControl(new OpenLayers.Control.MouseToolbar());
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.addControl(new OpenLayers.Control.Permalink());
map.addControl(new OpenLayers.Control.Permalink($('permalink')));
if (!map.getCenter()) map.zoomToMaxExtent();
}
// -->
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<a style="float:right" href="" id="permalink">Permalink</a>
<div id="map"></div>
</body>
</html>

View File

@@ -0,0 +1,17 @@
<html>
<head>
<script src="../lib/OpenLayers.js"></script>
</head>
<body>
<div style="width:100%; height:100%" id="map"></div>
<script defer="defer" type="text/javascript">
var map = new OpenLayers.Map('map');
var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(wms);
map.setCenter(new OpenLayers.LonLat(100,10));
map.setCenter(new OpenLayers.LonLat(1,1));
</script>
</body>
</html>

View File

@@ -2,8 +2,8 @@
<head>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -14,7 +14,7 @@
var map = new OpenLayers.Map('map');
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'});
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
"http://wms.jpl.nasa.gov/wms.cgi",
@@ -26,12 +26,10 @@
"prov_bound,fedlimit,rail,road,popplace",
transparent: "true", format: "image/png" });
jpl_wms.setVisibility(false);
dm_wms.setVisibility(false);
map.addLayers([ol_wms, jpl_wms, dm_wms]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
// map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.zoomToMaxExtent();
}
// -->
</script>

View File

@@ -27,10 +27,11 @@
function init(){
// these should be object methods or something
map = new OpenLayers.Map( $('map'), {maxExtent: new OpenLayers.Bounds(33861, 717605, 330846, 1019656), maxResolution: 296985/1024, projection:"EPSG:2805" } );
map = new OpenLayers.Map( $('map') );
var basemap = new OpenLayers.Layer.WMS( "Boston",
"http://boston.freemap.in/cgi-bin/mapserv?",
{map: '/www/freemap.in/boston/map/mass.map', layers: 'border,water,roads', format: 'png'} );
{map: '/www/freemap.in/boston/map/gmaps.map', layers: 'border,water,roads', format: 'png', 'transparent': 'off'},
{maxExtent: new OpenLayers.Bounds(33861, 717605, 330846, 1019656), maxResolution: 296985/1024, projection:"EPSG:2805" } );
var rapid = new OpenLayers.Layer.WMS( "Rapid Transit",
"http://boston.freemap.in/cgi-bin/mapserv?",
{map: '/www/freemap.in/boston/map/mass.map', layers: 'rapid_transit', format: 'png', transparent:'true'} );

43
examples/georss.html Normal file
View File

@@ -0,0 +1,43 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 800px;
height: 400px;
border: 1px solid black;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
<!--
var map, layer;
OpenLayers.ProxyHost = "/proxy/?url=";
function init(){
map = new OpenLayers.Map('map', {maxResolution:'auto'});
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.addControl(new OpenLayers.Control.LayerSwitcher());
}
function addUrl() {
var value = $('url').value;
var parts = value.split("/");
var newl = new OpenLayers.Layer.GeoRSS( parts[parts.length-1], value);
map.addLayer(newl);
$("url").value = "";
}
// -->
</script>
</head>
<body onload="init()">
<h1>GeoRSS in OpenLayers</h1>
<p style="font-size:.9em;">This demo uses the OpenLayers GeoRSS parser, which supports GeoRSS Simple and W3C GeoRSS. Only points are currently supported. <a href="http://trac.openlayers.org/wiki/HowToDownload">Get the code!</a></p>
<form onsubmit="return false;">
GeoRSS URL: <input type="text" id="url" size="50" /><input type="submit" onclick="addUrl(); return false;" value="Load Feed" onsubmit="addUrl(); return false;" />
</form>
<div id="map"></div>
</body>
</html>

378
examples/georss.xml Normal file
View File

@@ -0,0 +1,378 @@
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/css" href="/css/rss.css" ?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://purl.org/rss/1.0/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:georss="http://www.georss.org/georss">
<docs>This is an RSS file. Copy the URL into your aggregator of choice. If you don't know what this means and want to learn more, please see: <span>http://platial.typepad.com/news/2006/04/really_simple_t.html</span> for more info.</docs><channel rdf:about="http://platial.com">
<link>http://platial.com</link>
<title>Crschmidt's Places At Platial</title>
<description></description>
<items>
<rdf:Seq>
<rdf:li resource="http://platial.com/place/90306"/>
<rdf:li resource="http://platial.com/place/67230"/>
<rdf:li resource="http://platial.com/place/65645"/>
<rdf:li resource="http://platial.com/place/62200"/>
<rdf:li resource="http://platial.com/place/28232"/>
<rdf:li resource="http://platial.com/place/43666"/>
<rdf:li resource="http://platial.com/place/28394"/>
<rdf:li resource="http://platial.com/place/28251"/>
<rdf:li resource="http://platial.com/place/28392"/>
<rdf:li resource="http://platial.com/place/28391"/>
<rdf:li resource="http://platial.com/place/28231"/>
<rdf:li resource="http://platial.com/place/28393"/>
<rdf:li resource="http://platial.com/place/31685"/>
<rdf:li resource="http://platial.com/place/28596"/>
<rdf:li resource="http://platial.com/place/28595"/>
<rdf:li resource="http://platial.com/place/28594"/>
<rdf:li resource="http://platial.com/place/28593"/>
<rdf:li resource="http://platial.com/place/28592"/>
<rdf:li resource="http://platial.com/place/28591"/>
<rdf:li resource="http://platial.com/place/28590"/>
<rdf:li resource="http://platial.com/place/28589"/>
<rdf:li resource="http://platial.com/place/28588"/>
<rdf:li resource="http://platial.com/place/28587"/>
<rdf:li resource="http://platial.com/place/28586"/>
<rdf:li resource="http://platial.com/place/28585"/>
<rdf:li resource="http://platial.com/place/28584"/>
<rdf:li resource="http://platial.com/place/28583"/>
<rdf:li resource="http://platial.com/place/28582"/>
<rdf:li resource="http://platial.com/place/28581"/>
<rdf:li resource="http://platial.com/place/28580"/>
<rdf:li resource="http://platial.com/place/28579"/>
<rdf:li resource="http://platial.com/place/28578"/>
<rdf:li resource="http://platial.com/place/28577"/>
<rdf:li resource="http://platial.com/place/28576"/>
<rdf:li resource="http://platial.com/place/28575"/>
<rdf:li resource="http://platial.com/place/28574"/>
<rdf:li resource="http://platial.com/place/28573"/>
<rdf:li resource="http://platial.com/place/28572"/>
<rdf:li resource="http://platial.com/place/28571"/>
<rdf:li resource="http://platial.com/place/28570"/>
</rdf:Seq>
</items>
</channel>
<item rdf:about="http://platial.com/place/90306">
<link>http://platial.com/place/90306</link>
<title>Knitting Room</title>
<description><![CDATA[This little shop is jammed full. Yarn, yarn everywhere. They make the most of every possible nook and cranny. I like this place also because they have a lot of different kinds of knitting needles in all different sizes. Also, the people who work here are younger and hipper than in the other stores I go to. I reccomend buying supplies here and then knitting your way through a good documentary at the Capitol Theater across the street.<br/>Address: 2 lake St, Arlington, MA <br/>Tags: knitting, yarn, pins and needles, handspun, hand dyed, novelty yarn, fancy, simple, young, hip, friendly, needles, addy, cute hats<br /><br /><a href="http://platial.com/place/90306">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/90306">Grab this on Platial</a> ]]></description>
<georss:point>42.405696 -71.142197</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-06-08T17:35:01.942452+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/67230">
<link>http://platial.com/place/67230</link>
<title>Knitting Room</title>
<description><![CDATA[This little shop is jammed full. Yarn, yarn everywhere. They make the most of every possible nook and cranny. I like this place also because they have a lot of different kinds of knitting needles in all different sizes. Also, the people who work here are younger and hipper than in the other stores I go to. I reccomend buying supplies here and then knitting your way through a good documentary at the Capitol Theater across the street.<br/>Address: 2 lake St, Arlington, MA <br/>Tags: knitting, yarn, pins and needles, handspun, hand dyed, novelty yarn, fancy, simple, young, hip, friendly, needles, addy, cute hats<br /><br /><a href="http://platial.com/place/67230">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/67230">Grab this on Platial</a> ]]></description>
<georss:point>42.405524 -71.142273</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-04-24T11:35:26.733857+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/65645">
<link>http://platial.com/place/65645</link>
<title>†¢¢™£ˆøœ</title>
<description><![CDATA[ijeª£∆µˆ˚î<br/>Address: 151 Erie St., Cambridge, MA<br/>Tags: platial graffiti<br /><br /><a href="http://platial.com/place/65645">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/65645">Grab this on Platial</a> ]]></description>
<georss:point>42.352455 -71.110210</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-04-20T08:56:12.696224+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/62200">
<link>http://platial.com/place/62200</link>
<title>Allen Hall</title>
<description><![CDATA[My dorm at UIUC.<br/>Address: 1301 W Gregory Dr, Urbana, IL<br/>Tags: dorm, uiuc, college<br/><a href="http://platial.com/place/62200"><img src="http://platial.comhttp://static.flickr.com/4/8576450_0d59cc2531_s.jpg"/></a><br/><br /><br /><a href="http://platial.com/place/62200">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/62200">Grab this on Platial</a> ]]></description>
<georss:point>40.104172 -88.220623</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-04-14T08:01:01.872873+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28232">
<link>http://platial.com/place/28232</link>
<title>Bagby Hot Springs, OR</title>
<description><![CDATA[Hot spring, temperature: 136 degress F, 58 degress C. However, the area around the springs are not exactly well looked upon by people who know the place.
<br/>Tags: 20s, rosalie, romance, childhood, hike, camping, soak, relax, beautiful, hot springs, bathhouse, favorite, popular, crowded, organized, honeymoon tub, plumbing made from hollowed out trees, hot springs, mt hood, notorious car break in spot, rash, bacteria<br /><br /><a href="http://platial.com/place/28232">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28232">Grab this on Platial</a> ]]></description>
<georss:point>44.936000 -122.173000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:10:18.553063+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/43666">
<link>http://platial.com/place/43666</link>
<title>Shooting Location for "The Field of Dreams" Film</title>
<description><![CDATA[1989's Field of Dreams was a Best Picture Academy Award nominee, and the baseball field in the cornfield still stands today, and has become quite a tourist destination. Games are occasionally played at the field, re-enacting professional baseball at the turn of the 20th Century.<br/>Address: Dyersville, Iowa<br/>Tags: iowa, baseball, movie locations, field of dreams, kevin costner, costner, dyersville, kinsella, james earl jones, chicago black sox, shoeless joe, joe jackson, famous farms, film, movie, cinema, shooting location<br /><br /><a href="http://platial.com/place/43666">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/43666">Grab this on Platial</a> ]]></description>
<georss:point>42.481213 -91.111679</georss:point>
<dc:creator>echinodermata</dc:creator>
<dc:date>2006-03-23T11:40:17.654061+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28394">
<link>http://platial.com/place/28394</link>
<title>Moffetts (Bonneville) Hot Springs, WA</title>
<description><![CDATA[Hot spring, temperature: 97 degress F, 36 degress C<br/>Tags: soak, hot springs, relax, nature<br /><br /><a href="http://platial.com/place/28394">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28394">Grab this on Platial</a> ]]></description>
<georss:point>45.658000 -121.962000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:16:27.329816+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28251">
<link>http://platial.com/place/28251</link>
<title>Austin Hot Springs, OR</title>
<description><![CDATA[Hot spring, temperature: 186 degress F, 86 degress C<br/>Tags: soak, hot springs, relax, nature, popular, crowded<br /><br /><a href="http://platial.com/place/28251">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28251">Grab this on Platial</a> ]]></description>
<georss:point>45.021000 -122.009000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:11:04.489886+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28392">
<link>http://platial.com/place/28392</link>
<title>Rock Creek Hot Springs, WA</title>
<description><![CDATA[Hot spring, temperature: Hot degress F, Hot degress C<br/>Tags: soak, hot springs, relax, nature<br /><br /><a href="http://platial.com/place/28392">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28392">Grab this on Platial</a> ]]></description>
<georss:point>45.723000 -121.927000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:16:22.636855+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28391">
<link>http://platial.com/place/28391</link>
<title>St. Martins (Wind River) Hot Springs, WA</title>
<description><![CDATA[Hot spring, temperature: 120 degress F, 49 degress C<br/>Tags: hot springs, soak, relax, nature, wonderful<br /><br /><a href="http://platial.com/place/28391">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28391">Grab this on Platial</a> ]]></description>
<georss:point>45.728000 -121.800000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:16:20.383244+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28231">
<link>http://platial.com/place/28231</link>
<title>Breitenbush Hot Springs, OR</title>
<description><![CDATA[Hot spring, temperature: 198 degress F, 92 degress C<br/>Tags: hot springs, resort, relax, nature, beautiful, http:www.breitenbush.com, soaking<br /><br /><a href="http://platial.com/place/28231">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28231">Grab this on Platial</a> ]]></description>
<georss:point>44.782000 -121.975000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:10:16.529195+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28393">
<link>http://platial.com/place/28393</link>
<title>Collins Hot Springs, WA</title>
<description><![CDATA[Hot spring, temperature: 122 degress F, 50 degress C<br/>Tags: portland, nice, hot springs, soak<br /><br /><a href="http://platial.com/place/28393">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28393">Grab this on Platial</a> ]]></description>
<georss:point>45.701000 -121.728000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:16:24.648745+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/31685">
<link>http://platial.com/place/31685</link>
<title>Darwin's Ltd.</title>
<description><![CDATA[Nice little coffee shop/cafe, free Wifi, close enough to walk from Harvard Square.<br/>Address: 148 Mount Auburn St, Cambridge, MA<br/>Tags: coffee, beer, sandwiches, freewifi<br/><a href="http://platial.com/place/31685"><img src="http://platial.comhttp://static.flickr.com/38/84885937_74fd3d1025_s.jpg"/></a><br/><br /><br /><a href="http://platial.com/place/31685">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/31685">Grab this on Platial</a> ]]></description>
<georss:point>42.373974 -71.125053</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-10T09:24:08.152985+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28596">
<link>http://platial.com/place/28596</link>
<title>Huckleberry Hot Springs, WY</title>
<description><![CDATA[Hot spring, temperature: Boiling degress F, Boiling degress C<br /><br /><a href="http://platial.com/place/28596">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28596">Grab this on Platial</a> ]]></description>
<georss:point>44.115000 -110.684000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:24:32.283094+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28595">
<link>http://platial.com/place/28595</link>
<title>South Entrance Hot Springs, WY</title>
<description><![CDATA[Hot spring, temperature: 156 degress F, 69 degress C<br/><a href="http://platial.com/place/28595"><img src="http://platial.comhttp://static.flickr.com/52/130989872_f1457f68b5_s.jpg"/></a><br/><br /><br /><a href="http://platial.com/place/28595">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28595">Grab this on Platial</a> ]]></description>
<georss:point>44.142000 -110.656000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:24:30.279497+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28594">
<link>http://platial.com/place/28594</link>
<title>Crawfish Creek Hot Springs, WY</title>
<description><![CDATA[Hot spring, temperature: 136 degress F, 58 degress C<br/><a href="http://platial.com/place/28594"><img src="http://platial.comhttp://static.flickr.com/52/128312256_d6a879924c_s.jpg"/></a><br/><br /><br /><a href="http://platial.com/place/28594">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28594">Grab this on Platial</a> ]]></description>
<georss:point>44.157000 -110.699000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:24:28.280271+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28593">
<link>http://platial.com/place/28593</link>
<title>Crawfish Creek Hot Springs, WY</title>
<description><![CDATA[Hot spring, temperature: 138 degress F, 59 degress C<br /><br /><a href="http://platial.com/place/28593">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28593">Grab this on Platial</a> ]]></description>
<georss:point>44.165000 -110.723000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:24:20.364077+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28592">
<link>http://platial.com/place/28592</link>
<title>Snake Hot Springs, WY</title>
<description><![CDATA[Hot spring, temperature: 136 degress F, 58 degress C<br /><br /><a href="http://platial.com/place/28592">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28592">Grab this on Platial</a> ]]></description>
<georss:point>44.169000 -110.583000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:24:12.234974+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28591">
<link>http://platial.com/place/28591</link>
<title>Hot Springs, WY</title>
<description><![CDATA[Hot spring, temperature: 142 degress F, 61 degress C<br /><br /><a href="http://platial.com/place/28591">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28591">Grab this on Platial</a> ]]></description>
<georss:point>44.187000 -110.726000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:24:10.027857+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28590">
<link>http://platial.com/place/28590</link>
<title>Hot Springs on Upper Snake River, WY</title>
<description><![CDATA[Hot spring, temperature: 167 degress F, 75 degress C<br /><br /><a href="http://platial.com/place/28590">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28590">Grab this on Platial</a> ]]></description>
<georss:point>44.204000 -110.486000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:24:07.79658+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28589">
<link>http://platial.com/place/28589</link>
<title>Hot Springs on lewis Lake, WY</title>
<description><![CDATA[Hot spring, temperature: 154 degress F, 68 degress C<br /><br /><a href="http://platial.com/place/28589">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28589">Grab this on Platial</a> ]]></description>
<georss:point>44.276000 -110.636000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:24:05.683418+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28588">
<link>http://platial.com/place/28588</link>
<title>Rustic Geyser, WY</title>
<description><![CDATA[Hot spring, temperature: 199 degress F, 93 degress C<br /><br /><a href="http://platial.com/place/28588">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28588">Grab this on Platial</a> ]]></description>
<georss:point>44.282000 -110.506000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:24:03.66329+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28587">
<link>http://platial.com/place/28587</link>
<title>Bechler River Hot Springs, WY</title>
<description><![CDATA[Hot spring, temperature: 194 degress F, 90 degress C<br /><br /><a href="http://platial.com/place/28587">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28587">Grab this on Platial</a> ]]></description>
<georss:point>44.285000 -110.900000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:24:01.611442+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28586">
<link>http://platial.com/place/28586</link>
<title>Hot Springs, WY</title>
<description><![CDATA[Hot spring, temperature: Boiling degress F, 201 degress C<br /><br /><a href="http://platial.com/place/28586">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28586">Grab this on Platial</a> ]]></description>
<georss:point>44.290000 -110.504000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:23:59.658699+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28585">
<link>http://platial.com/place/28585</link>
<title>Heart Lake Geyser Basin, WY</title>
<description><![CDATA[Hot spring, temperature: Middle Group degress F, 174 degress C<br /><br /><a href="http://platial.com/place/28585">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28585">Grab this on Platial</a> ]]></description>
<georss:point>44.299000 -110.517000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:23:57.181801+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28584">
<link>http://platial.com/place/28584</link>
<title>Hot Springs, WY</title>
<description><![CDATA[Hot spring, temperature: Boiling degress F, 201 degress C<br /><br /><a href="http://platial.com/place/28584">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28584">Grab this on Platial</a> ]]></description>
<georss:point>44.307000 -110.526000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:23:55.240485+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28583">
<link>http://platial.com/place/28583</link>
<title>Hot Springs on lewis Lake, WY</title>
<description><![CDATA[Hot spring, temperature: 199 degress F, 93 degress C<br /><br /><a href="http://platial.com/place/28583">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28583">Grab this on Platial</a> ]]></description>
<georss:point>44.309000 -110.654000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:23:53.22295+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28582">
<link>http://platial.com/place/28582</link>
<title>Shoshone Geyser Basin, WY</title>
<description><![CDATA[Hot spring, temperature: 203 degress F, 95 degress C<br /><br /><a href="http://platial.com/place/28582">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28582">Grab this on Platial</a> ]]></description>
<georss:point>44.354000 -110.800000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:23:51.179049+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28581">
<link>http://platial.com/place/28581</link>
<title>Hot Springs on Continental Divide, WY</title>
<description><![CDATA[Hot spring, temperature: 189 degress F, 87 degress C<br /><br /><a href="http://platial.com/place/28581">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28581">Grab this on Platial</a> ]]></description>
<georss:point>44.401000 -110.936000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:23:49.077176+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28580">
<link>http://platial.com/place/28580</link>
<title>Hot Springs on Upper Firehole River, WY</title>
<description><![CDATA[Hot spring, temperature: Hot degress F, Hot degress C<br /><br /><a href="http://platial.com/place/28580">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28580">Grab this on Platial</a> ]]></description>
<georss:point>44.404000 -110.824000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:23:47.054664+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28579">
<link>http://platial.com/place/28579</link>
<title>Summit Lake Hot Springs, WY</title>
<description><![CDATA[Hot spring, temperature: 162 degress F, 72 degress C<br /><br /><a href="http://platial.com/place/28579">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28579">Grab this on Platial</a> ]]></description>
<georss:point>44.410000 -110.953000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:23:45.039394+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28578">
<link>http://platial.com/place/28578</link>
<title>Lone Star Geyser Basin, WY</title>
<description><![CDATA[Hot spring, temperature: Footbridge degress F, 183 degress C<br /><br /><a href="http://platial.com/place/28578">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28578">Grab this on Platial</a> ]]></description>
<georss:point>44.414000 -110.817000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:23:42.938808+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28577">
<link>http://platial.com/place/28577</link>
<title>West. Thumb Geyser Basin, WY</title>
<description><![CDATA[Hot spring, temperature: 203 degress F, 95 degress C<br /><br /><a href="http://platial.com/place/28577">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28577">Grab this on Platial</a> ]]></description>
<georss:point>44.417000 -110.570000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:23:40.90238+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28576">
<link>http://platial.com/place/28576</link>
<title>Lone Star Geyser, WY</title>
<description><![CDATA[Hot spring, temperature: 199 degress F, 93 degress C<br /><br /><a href="http://platial.com/place/28576">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28576">Grab this on Platial</a> ]]></description>
<georss:point>44.418000 -110.805000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:23:38.844625+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28575">
<link>http://platial.com/place/28575</link>
<title>Smoke Jumper Hot Springs, WY</title>
<description><![CDATA[Hot spring, temperature: 198 degress F, 92 degress C<br /><br /><a href="http://platial.com/place/28575">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28575">Grab this on Platial</a> ]]></description>
<georss:point>44.421000 -110.952000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:23:36.818513+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28574">
<link>http://platial.com/place/28574</link>
<title>West. Thumb Geyser Basin, WY</title>
<description><![CDATA[Hot spring, temperature: 196 degress F, 91 degress C<br /><br /><a href="http://platial.com/place/28574">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28574">Grab this on Platial</a> ]]></description>
<georss:point>44.422000 -110.574000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:23:34.767729+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28573">
<link>http://platial.com/place/28573</link>
<title>Potts Hot Spring Basin, WY</title>
<description><![CDATA[Hot spring, temperature: 203 degress F, 95 degress C<br /><br /><a href="http://platial.com/place/28573">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28573">Grab this on Platial</a> ]]></description>
<georss:point>44.433000 -110.581000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:23:32.749915+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28572">
<link>http://platial.com/place/28572</link>
<title>Hot Springs, WY</title>
<description><![CDATA[Hot spring, temperature: Hot degress F, Hot degress C<br /><br /><a href="http://platial.com/place/28572">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28572">Grab this on Platial</a> ]]></description>
<georss:point>44.433000 -110.813000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:23:30.829745+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28571">
<link>http://platial.com/place/28571</link>
<title>Hot Springs on Continental Divide, WY</title>
<description><![CDATA[Hot spring, temperature: Hot degress F, Hot degress C<br /><br /><a href="http://platial.com/place/28571">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28571">Grab this on Platial</a> ]]></description>
<georss:point>44.438000 -110.977000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:23:28.730401+00:00</dc:date>
</item>
<item rdf:about="http://platial.com/place/28570">
<link>http://platial.com/place/28570</link>
<title>SouthEastern Group, WY</title>
<description><![CDATA[Hot spring, temperature: 198 degress F, 92 degress C<br /><br /><a href="http://platial.com/place/28570">Map this on Platial</a><br /> <a href="http://platial.com/place_grab/28570">Grab this on Platial</a> ]]></description>
<georss:point>44.459000 -110.817000</georss:point>
<dc:creator>crschmidt</dc:creator>
<dc:date>2006-01-03T23:23:26.706763+00:00</dc:date>
</item>
</rdf:RDF>

View File

@@ -3,12 +3,17 @@
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 100%;
height: 512px;
border: 1px solid black;
background-color: red;
}
</style>
<!-- this gmaps key generated for http://openlayers.org/dev/ -->
<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA9XNhd8q0UdwNC7YSO4YZghSPUCi5aRYVveCcVYxzezM4iaj_gxQ9t-UajFL70jfcpquH5l1IJ-Zyyw'></script>
<!-- Localhost key -->
<!-- <script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTS6gjckBmeABOGXIUiOiZObZESPg'></script>-->
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
<!--
@@ -18,21 +23,52 @@
var map, layer;
function init(){
map = new OpenLayers.Map( $('map') );
gmap = new OpenLayers.Layer.Google( "Google" );
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map = new OpenLayers.Map( $('map') ,
{ controls: [new OpenLayers.Control.MouseDefaults()] });
var normal = new OpenLayers.Layer.Google( "Google", // );
{ minZoomLevel: 3, maxZoomLevel: 8 });
var satellite = new OpenLayers.Layer.Google( "Google Satellite" , {type: G_SATELLITE_MAP });
var hybrid = new OpenLayers.Layer.Google( "Google Hybrid" , {type: G_HYBRID_MAP });
map.addLayers([satellite, normal, hybrid]);
markers = new OpenLayers.Layer.Markers("markers");
map.addLayer(markers);
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
map.addLayer(layer);
map.addLayer(gmap);
map.addControl( new OpenLayers.Control.LayerSwitcher() );
map.addControl( new OpenLayers.Control.PanZoomBar() );
}
// -->
function add() {
var url = 'http://boston.openguides.org/markers/AQUA.png';
var sz = new OpenLayers.Size(10, 17);
var calculateOffset = function(size) {
return new OpenLayers.Pixel(-(size.w/2), -size.h);
};
var icon = new OpenLayers.Icon(url, sz, null, calculateOffset);
var barcelona = new OpenLayers.LonLat(2.13134765625,
41.37062534198901);
marker = new OpenLayers.Marker(barcelona, icon);
markers.addMarker(marker);
}
function remove() {
markers.removeMarker(marker);
}
// -->
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<h1>OpenLayers With Google Layer Example</h1>
<div id="map"></div>
<div style="background-color:green" onclick="add()"> click to add a marker to the map</div>
<div style="background-color:red" onclick="remove()"> click to remove the marker from the map</div>
</body>
</html>

View File

@@ -11,17 +11,23 @@
<script type="text/javascript">
<!--
function init(){
var map = new OpenLayers.Map('map', {'maxResolution': 1.40625/4});
var map = new OpenLayers.Map('map');
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
var ka_wms = new OpenLayers.Layer.KaMap( "KaMap",
"http://www.h2guide.com/my-ka-map/h2tile.php?" , { map: 'h2guide', g: 'background' }, new OpenLayers.LonLat(0,0));
var ol_wms = new OpenLayers.Layer.WMS( "World Map",
"http://labs.metacarta.com/wms/vmap0?",
{layers: 'basic'} );
var jpl_wms = new OpenLayers.Layer.KaMap( "Satellite",
"http://www.openlayers.org/world/index.php", {g: "satellite", map: "world"});
var dm_wms = new OpenLayers.Layer.WMS( "Canada",
"http://www2.dmsolutions.ca/cgi-bin/mswms_gmap",
{layers: "bathymetry,land_fn,park,drain_fn,drainage," +
"prov_bound,fedlimit,rail,road,popplace",
transparent: "true", format: "image/png" });
map.addLayers([ol_wms, ka_wms]);
map.addLayers([ol_wms, jpl_wms, dm_wms]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.zoomToMaxExtent();
}
// -->
</script>

508
examples/kamap.txt Normal file
View File

@@ -0,0 +1,508 @@
<?php
/*
This is a PHP file to be used as a backend for a ka-Map layer. It requires
PHP with Mapscript and libgd modules installed. The top of the file
is a configuration section: please edit the variables in this configuration
section to meet your needs, then rename this file to tile.php or something
similar and put it in a web accessible directory. More information
on the OpenLayers ka-Map layer is available from:
http://trac.openlayers.org/wiki/OpenLayers.Layer.KaMap
*/
/**********************************************************************
*
* $Id: tile.php,v 1.33 2006/02/07 03:19:55 pspencer Exp $
*
* purpose: a simple phpmapscript-based tile renderer that implements
* rudimentary caching for reasonable efficiency. Note the
* cache never shrinks in this version so your disk could
* easily fill up!
*
* author: Paul Spencer (pspencer@dmsolutions.ca)
*
* modifications by Daniel Morissette (dmorissette@dmsolutions.ca)
*
* Modified by Christopher Schmidt for OpenLayers redistribution.
*
**********************************************************************
*
* Copyright (c) 2005, DM Solutions Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
**********************************************************************/
/******************************************************************************
* basic system configuration
*
* kaMap! uses PHP/MapScript and the PHP GD extension to
* render tiles, and uses PHP/MapScript to generate initialization parameters
* a legend, and a keymap from the selected map file.
*
* Make sure to set the correct module names for your PHP extensions.
*
* WINDOWS USERS: you will likely need to use php_gd2.dll instead of php_gd.dll
*/
$szPHPMapScriptModule = 'php_mapscript.'.PHP_SHLIB_SUFFIX;
$szPHPGDModule = 'php_gd.'.PHP_SHLIB_SUFFIX;
/******************************************************************************
* tile generation parameters
*
* kaMap! generates tiles to load in the client application by first rendering
* larger areas from the map file and then slicing them up into smaller tiles.
* This approach reduces the overhead of loading PHP/MapScript and PHP GD and
* drawing the map file. These larger areas are referred to as metaTiles in
* the code. You can set the size of both the small tiles and the metaTiles
* here. A reasonable size for the small tiles seems to be 200 pixels square.
* Smaller tiles seem to cause problems in client browsers by causing too many
* images to be created and thus slowing performance of live dragging. Larger
* tiles take longer to download to the client and are inefficient.
*
* The number of smaller tiles that form a metaTile can also be configured.
* This parameter allows tuning of the tile generator to ensure optimal
* performance and for label placement. MapServer will produce labels only
* within a rendered area. If the area is too small then features may be
* labelled multiple times. If the area is too large, it may exceed MapServer,s
* maximum map size (by default 2000x2000) or be too resource-intensive on the
* server, ultimately reducing performance.
*/
$tileWidth = 256;
$tileHeight = 256;
$metaWidth = 5;
$metaHeight = 5;
/* $metaBuffer = Buffer size in pixels to add around metatiles to avoid
* rendering issues along the edge of the map image
*/
$metaBuffer = 10;
/******************************************************************************
* in-image debugging information - tile location, outlines etc.
* to use this, you need to remove images from your cache first. This also
* affects the meta tiles - if debug is on, they are not deleted.
*/
$bDebug = false;
/******************************************************************************
* aszMapFiles - an array of map files available to the application. How this
* is used is determined by the application. Each map file is entered into
* this array as a key->value pair.
*
* The key is the name to be used by the tile caching system to store cached
* tiles within the base cache directory. This key should be a single word
* that uniquely identifies the map.
*
* The value associated with each key is an array of three values. The first
* value is a human-readable name to be presented to the user (should the
* application choose to do so) and the second value is the path to the map
* file. It is assumed that the map file is fully configured for use with
* MapServer/MapScript as no error checking or setting of values is done. The
* third value is an array of scale values for zooming.
*/
$aszMapFiles = array(
"world" => array( "World", "/path/to/your/mapfile",
array( 10000 ), # in openlayers, the scale array doesn't matter.
"PNG24")
/* Add more elements to this array to offer multiple mapfiles */
);
/******************************************************************************
* figure out which map file to use and set up the necessary variables for
* the rest of the code to use. This does need to be done on every page load
* unfortunately.
*
* szMap should be set to the default map file to use but can change if
* this script is called with map=<mapname>.
*/
$szMap = 'world';
/******************************************************************************
* kaMap! caching
*
* this is the directory within which kaMap! will create its tile cache. The
* directory does NOT have to be web-accessible, but it must be writable by the
* web-server-user and allow creation of both directories AND files.
*
* the tile caching system will create a separate subdirectory within the base
* cache directory for each map file. Within the cache directory for each map
* file, directories will be created for each group of layers. Within the group
* directories, directories will be created at each of the configured scales
* for the application (see mapfile configuration above.)
*/
$szBaseCacheDir = "/var/cache/kamap/";
/***** END OF CONFIGURABLE STUFF - unless you know what you are doing *****/
/***** *****/
/***** *****/
/***** *****/
/***** END OF CONFIGURABLE STUFF - unless you know what you are doing *****/
if (isset($_REQUEST['map']) && isset($aszMapFiles[$_REQUEST['map']]))
{
$szMap = $_REQUEST['map'];
}
$szMapCacheDir = $szBaseCacheDir.$szMap."/";
$szMapName = $aszMapFiles[$szMap][0];
$szMapFile = $aszMapFiles[$szMap][1];
$anScales = $aszMapFiles[$szMap][2];
setOutputFormat($aszMapFiles[$szMap][3]);
/******************************************************************************
* output format of the map and resulting tiles
*
* The output format used with MapServer can greatly affect appearance and
* performance. It is recommended to use an 8 bit format such as PNG
*
* NOTE: the tile caching code in tile.php is not configurable here. It
* currently assumes that it is outputting 8bit PNG files. If you change to
* PNG24 here then you will need to update tile.php to use the gd function
* imagecreatetruecolor. If you change the output format to jpeg then
* you would need to change imagepng() to imagejpeg(). A nice enhancement
* would be to make that fully configurable from here.
*/
function setOutputFormat($szFormat)
{
switch($szFormat) {
case "PNG24":
$GLOBALS['szMapImageFormat'] = 'PNG24'; //mapscript format name
$GLOBALS['szMapImageCreateFunction'] = "imagecreatefrompng"; // appropriate GD function
$GLOBALS['szImageExtension'] = '.png'; //file extension
$GLOBALS['szImageCreateFunction'] = "imagecreatetruecolor"; //or imagecreatetruecolor if PNG24 ...
$GLOBALS['szImageOutputFunction'] = "imagepng"; //or imagegif, imagejpeg ...
$GLOBALS['szImageHeader'] = 'image/png'; //the content-type of the image
break;
case "GIF":
$GLOBALS['szMapImageFormat'] = 'GIF'; //mapscript format name
$GLOBALS['szMapImageCreateFunction'] = "imagecreatefromgif"; // appropriate GD function
$GLOBALS['szImageExtension'] = '.gif'; //file extension
$GLOBALS['szImageCreateFunction'] = "imagecreate"; //or imagecreatetruecolor if PNG24 ...
$GLOBALS['szImageOutputFunction'] = "imagegif"; //or imagegif, imagejpeg ...
$GLOBALS['szImageHeader'] = 'image/gif'; //the content-type of the image
break;
case "JPEG":
$GLOBALS['szMapImageFormat'] = 'JPEG'; //mapscript format name
$GLOBALS['szMapImageCreateFunction'] = "imagecreatefromjpeg"; // appropriate GD function
$GLOBALS['szImageExtension'] = '.jpg'; //file extension
$GLOBALS['szImageCreateFunction'] = "imagecreatetruecolor"; //or imagecreatetruecolor if PNG24 ...
$GLOBALS['szImageOutputFunction'] = "imagejpeg"; //or imagegif, imagejpeg ...
$GLOBALS['szImageHeader'] = 'image/jpeg'; //the content-type of the image
break;
case "PNG":
$GLOBALS['szMapImageFormat'] = 'PNG'; //mapscript format name
$GLOBALS['szMapImageCreateFunction'] = "imagecreatefrompng"; // appropriate GD function
$GLOBALS['szImageExtension'] = '.png'; //file extension
$GLOBALS['szImageCreateFunction'] = "imagecreate"; //or imagecreatetruecolor if PNG24 ...
$GLOBALS['szImageOutputFunction'] = "imagepng"; //or imagegif, imagejpeg ...
$GLOBALS['szImageHeader'] = 'image/png'; //the content-type of the image
break;
case "DITHERED":
case "PNG8":
$GLOBALS['szMapImageFormat'] = 'dithered';
$GLOBALS['szMapImageCreateFunction'] = "imagecreatefrompng";
$GLOBALS['szImageExtension'] = '.png';
$GLOBALS['szImageCreateFunction'] = "imagecreate";
$GLOBALS['szImageOutputFunction'] = "imagepng";
$GLOBALS['szImageHeader'] = 'image/png';
break;
}
}
/**
* create all directories in a directory tree - found on the php web site
* under the mkdir function ...
*/
function makeDirs($strPath, $mode = 0775)
{
return is_dir($strPath) or ( makeDirs(dirname($strPath), $mode) and mkdir($strPath, $mode) );
}
/**
* This function replaces all special characters in the given string.
*
* @param szString string - The string to convert.
*
* @return string converted
*/
function normalizeString($szString)
{
// Normalize string by replacing all special characters
// e.g. "http://my.host.com/cgi-bin/mywms?"
// becomes "http___my_host_com_cgi_bin_mywms_"
return preg_replace("/(\W)/", "_", $szString);
}
/* bug 1253 - root permissions required to delete cached files */
$orig_umask = umask(0);
/* create the main cache directory if necessary */
if (!@is_dir($szMapCacheDir))
makeDirs($szMapCacheDir);
/* get the various request parameters
* also need to make sure inputs are clean, especially those used to
* build paths and filenames
*/
/*
* the tile renderer accepts several parameters and returns a tile image from
* the cache, creating the tile only if necessary.
*
* all requests include the pixel location of the request at a certain scale
* and this script figures out the geographic location of the tile from the
* scale assuming that 0,0 in pixels is 0,0 in geographic units
*
* Request parameters are:
*
* map: the name of the map to use. This is handled by config.php.
*
* t: top pixel position
* l: left pixel position
* s: scale
* g: (optional) comma-delimited list of group names to draw
* layers: (optional) comma-delimited list of layers to draw
* force: optional. If set, force redraw of the meta tile. This was added to
* help with invalid images sometimes being generated.
* tileid: (optional) can be used instead of t+l to specify the tile coord.,
* useful in regenerating the cache
*/
$top = isset( $_REQUEST['t'] ) ? intval($_REQUEST['t']) : 0;
$left = isset( $_REQUEST['l'] ) ? intval($_REQUEST['l']) : 0;
$scale = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : $anScales[0];
$bForce = isset($_REQUEST['force'])? true : false;
$groups = isset( $_REQUEST['g'] ) ? $_REQUEST['g'] : "";
$layers = isset( $_REQUEST['layers'] ) ? $_REQUEST['layers'] : "";
// dynamic imageformat ----------------------------------------------
//use the function in config.php to set the output format
if (isset($_REQUEST['i']))
setOutputFormat( $_REQUEST['i'] );
//----------------------------------------------------------------
/* tileid=t#####l#### can be used instead of t+l parameters. Useful in
* regenerating the cache for instance.
*/
if (isset( $_REQUEST['tileid']) &&
preg_match("/t(-?\d+)l(-?\d+)/", $_REQUEST['tileid'], $aMatch) )
{
$top = intval($aMatch[1]);
$left = intval($aMatch[2]);
}
/* Calculate the metatile's top-left corner coordinates.
* Include the $metaBuffer around the metatile to account for various
* rendering issues happening around the edge of a map
*/
$metaLeft = floor( ($left)/($tileWidth*$metaWidth) ) * $tileWidth * $metaWidth;
$metaTop = floor( ($top)/($tileHeight*$metaHeight) ) * $tileHeight *$metaHeight;
$szMetaTileId = "t".$metaTop."l".$metaLeft;
$metaLeft -= $metaBuffer;
$metaTop -= $metaBuffer;
/* caching is done by scale value, then groups and layers and finally metatile
* and tile id. Create a new directory if necessary
*/
$szGroupDir = $groups != "" ? normalizeString($groups) : "def";
$szLayerDir = $layers != "" ? normalizeString($layers) : "def";
$szCacheDir = $szMapCacheDir."/".$scale."/".$szGroupDir."/".$szLayerDir."/".$szMetaTileId;
if (!@is_dir($szCacheDir))
makeDirs($szCacheDir);
/* resolve cache hit - clear the os stat cache if necessary */
$szTileId = "t".$top."l".$left;
$szCacheFile = $szCacheDir."/".$szTileId.$szImageExtension;
clearstatcache();
$szMetaDir = $szCacheDir."/meta";
if (!@is_Dir($szMetaDir))
makeDirs($szMetaDir);
/* simple locking in case there are several requests for the same meta
tile at the same time - only draw it once to help with performance */
$szLockFile = $szMetaDir."/lock_".$metaTop."_".$metaLeft;
$fpLockFile = fopen($szLockFile, "a+");
clearstatcache();
if (!file_exists($szCacheFile) || $bForce)
{
flock($fpLockFile, LOCK_EX);
fwrite($fpLockFile, ".");
//check once more to see if the cache file was created while waiting for
//the lock
clearstatcache();
if (!file_exists($szCacheFile) || $bForce)
{
if (!extension_loaded('MapScript'))
{
dl( $szPHPMapScriptModule );
}
if (!extension_loaded('gd'))
{
dl( $szPHPGDModule);
}
if (!@is_Dir($szMetaDir))
makeDirs($szMetaDir);
$oMap = ms_newMapObj($szMapFile);
/* Metatile width/height include 2x the metaBuffer value */
$oMap->set('width', $tileWidth * $metaWidth + 2*$metaBuffer);
$oMap->set('height', $tileHeight * $metaHeight + 2*$metaBuffer);
/* Tell MapServer to not render labels inside the metaBuffer area
* (new in 4.6)
* TODO: Until MapServer bugs 1353/1355 are resolved, we need to
* pass a negative value for "labelcache_map_edge_buffer"
*/
$oMap->setMetadata("labelcache_map_edge_buffer", -$metaBuffer);
$inchesPerUnit = array(1, 12, 63360.0, 39.3701, 39370.1, 4374754);
$geoWidth = $scale/($oMap->resolution*$inchesPerUnit[$oMap->units]);
$geoHeight = $scale/($oMap->resolution*$inchesPerUnit[$oMap->units]);
/* draw the metatile */
$minx = $metaLeft * $geoWidth;
$maxx = $minx + $geoWidth * $oMap->width;
$maxy = -1 * $metaTop * $geoHeight;
$miny = $maxy - $geoHeight * $oMap->height;
$nLayers = $oMap->numlayers;
$oMap->setExtent($minx,$miny,$maxx,$maxy);
$oMap->selectOutputFormat( $szMapImageFormat );
$aszLayers = array();
if ($groups || $layers)
{
/* Draw only specified layers instead of default from mapfile*/
if ($layers)
{
$aszLayers = explode(",", $layers);
}
if ($groups)
{
$aszGroups = explode(",", $groups);
}
for($i=0;$i<$nLayers;$i++)
{
$oLayer = $oMap->getLayer($i);
if (($aszGroups && in_array($oLayer->group,$aszGroups)) ||
($aszLayers && in_array($oLayer->name,$aszLayers)) ||
($aszGroups && $oLayer->group == '' &&
in_array( "__base__", $aszGroups)))
{
$oLayer->set("status", MS_ON );
}
else
{
$oLayer->set("status", MS_OFF );
}
}
//need transparency if groups or layers are used
$oMap->outputformat->set("transparent", MS_ON );
}
else
{
$oMap->outputformat->set("transparent", MS_OFF );
}
$szMetaImg = $szMetaDir."/t".$metaTop."l".$metaLeft.$szImageExtension;
$oImg = $oMap->draw();
$oImg->saveImage($szMetaImg);
$oImg->free();
eval("\$oGDImg = ".$szMapImageCreateFunction."('".$szMetaImg."');");
if ($bDebug)
{
$blue = imagecolorallocate($oGDImg, 0, 0, 255);
imagerectangle($oGDImg, 0, 0, $tileWidth * $metaWidth - 1, $tileHeight * $metaHeight - 1, $blue );
}
for($i=0;$i<$metaWidth;$i++)
{
for ($j=0;$j<$metaHeight;$j++)
{
eval("\$oTile = ".$szImageCreateFunction."( ".$tileWidth.",".$tileHeight." );");
// Allocate BG color for the tile (in case the metatile has transparent BG)
$nTransparent = imagecolorallocate($oTile, $oMap->imagecolor->red, $oMap->imagecolor->green, $oMap->imagecolor->blue);
//if ($oMap->outputformat->transparent == MS_ON)
//{
imagecolortransparent( $oTile,$nTransparent);
//}
$tileTop = $j*$tileHeight + $metaBuffer;
$tileLeft = $i*$tileWidth + $metaBuffer;
imagecopy( $oTile, $oGDImg, 0, 0, $tileLeft, $tileTop, $tileWidth, $tileHeight );
/* debugging stuff */
if ($bDebug)
{
$black = imagecolorallocate($oTile, 1, 1, 1);
$green = imagecolorallocate($oTile, 0, 128, 0 );
$red = imagecolorallocate($oTile, 255, 0, 0);
imagerectangle( $oTile, 1, 1, $tileWidth-2, $tileHeight-2, $green );
imageline( $oTile, 0, $tileHeight/2, $tileWidth-1, $tileHeight/2, $red);
imageline( $oTile, $tileWidth/2, 0, $tileWidth/2, $tileHeight-1, $red);
imagestring ( $oTile, 3, 10, 10, ($metaLeft+$tileLeft)." x ".($metaTop+$tileTop), $black );
imagestring ( $oTile, 3, 10, 30, ($minx+$i*$geoWidth)." x ".($maxy - $j*$geoHeight), $black );
}
$szTileImg = $szCacheDir."/t".($metaTop+$tileTop)."l".($metaLeft+$tileLeft).$szImageExtension;
eval("$szImageOutputFunction( \$oTile, '".$szTileImg."' );");
imagedestroy($oTile);
$oTile = null;
}
}
if ($oGDImg != null)
{
imagedestroy($oGDImg);
$oGDImg = null;
}
if (!$bDebug)
{
unlink( $szMetaImg );
}
}
//release the exclusive lock
flock($fpLockFile, LOCK_UN );
}
//acquire shared lock for reading to prevent a problem that could occur
//if a tile exists but is only partially generated.
flock($fpLockFile, LOCK_SH);
$h = fopen($szCacheFile, "r");
header("Content-Type: ".$szImageHeader);
header("Content-Length: " . filesize($szCacheFile));
header("Expires: " . date( "D, d M Y H:i:s GMT", time() + 31536000 ));
header("Cache-Control: max-age=31536000, must-revalidate" );
fpassthru($h);
fclose($h);
//release lock
fclose($fpLockFile);
/* bug 1253 - root permissions required to delete cached files */
umask($orig_umask);
exit;
?>

View File

@@ -3,8 +3,8 @@
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -25,14 +25,15 @@
size = new OpenLayers.Size(50,50);
calculateOffset = function(size) {
return new OpenLayers.Pixel(-(size.w/2), -size.h);
};
icon = new OpenLayers.Icon('http://boston.openguides.org/markers/AQUA.png',size,null, calculateOffset);
markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(-180,90),
icon));
return new OpenLayers.Pixel(-(size.w/2), -size.h); };
icon = new OpenLayers.Icon(
'http://boston.openguides.org/markers/AQUA.png',
size, null, calculateOffset);
markers.addMarker(
new OpenLayers.Marker(new OpenLayers.LonLat(-180,90), icon));
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToMaxExtent();
}
function resize() {

View File

@@ -3,8 +3,8 @@
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -14,25 +14,27 @@
var map, layer;
function init(){
OpenLayers.ProxyHost="/proxy/?url=";
map = new OpenLayers.Map('map');
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
var markers = new OpenLayers.Layer.Markers( "Markers" );
map.addLayer(markers);
var newl = new OpenLayers.Layer.Text( "text", "./textfile.txt" );
var newl = new OpenLayers.Layer.Text( "text", { location:"./textfile.txt"} );
map.addLayer(newl);
var size = new OpenLayers.Size(10,17);
var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
var icon = new OpenLayers.Icon('http://boston.openguides.org/markers/AQUA.png',size,offset);
markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(0,0),icon));
markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(0,45),icon));
marker = new OpenLayers.Marker(new OpenLayers.LonLat(90,10),icon);
markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(0,45),icon.clone()));
marker = new OpenLayers.Marker(new OpenLayers.LonLat(90,10),icon.clone());
marker.events.register('mousedown', marker, function(evt) { alert(this.icon.url); Event.stop(evt); });
markers.addMarker(marker);
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToMaxExtent();
}
// -->
</script>

View File

@@ -3,8 +3,8 @@
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -14,17 +14,18 @@
var map, layer;
function init(){
OpenLayers.ProxyHost="/proxy/?url=";
map = new OpenLayers.Map('map');
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(layer);
var newl = new OpenLayers.Layer.Text( "text", "./textfile.txt" );
var newl = new OpenLayers.Layer.Text( "text", {location: "./textfile.txt"} );
map.addLayer(newl);
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToMaxExtent();
}
// -->
</script>

View File

@@ -1,77 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 800px;
height: 475px;
border: 1px solid black;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
<!--
var map, layer, popup;
var marker, markers;
function init(){
map = new OpenLayers.Map('map');
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(
new OpenLayers.Layer.WMS("NASA Mosaic",
"http://wms.jpl.nasa.gov/wms.cgi",
{"EXCEPTIONS" : "application/vnd.ogc.se_inimage",
"format" : "image/jpeg",
layers:"modis,global_mosaic"}
));
map.addLayer(layer);
markers = new OpenLayers.Layer.Markers( "Markers" );
map.addLayer(markers);
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.addControl(new OpenLayers.Control.LayerSwitcher());
}
function changer() {
var lon = map.getLonLatFromLayerPx(new OpenLayers.Pixel(0,0)).lon;
var lat = map.getLonLatFromLayerPx(new OpenLayers.Pixel(0,0)).lat;
var slon = map.getLonLatFromViewPortPx(new OpenLayers.Pixel(0,0)).lon;
var slat = map.getLonLatFromViewPortPx(new OpenLayers.Pixel(0,0)).lat;
alert("lon=" + lon + " lat=" + lat
+ "slon=" + slon + " slat=" + slat);
}
function add() {
var icon = new OpenLayers.Icon('http://boston.openguides.org/markers/AQUA.png',new OpenLayers.Size(10,17));
marker = new OpenLayers.Marker(new OpenLayers.LonLat(0,00), icon);
markers.addMarker(marker);
}
function destroy() {
popup.destroy();
}
function remove() {
map.removePopup(popup);
}
// -->
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<div id="map"></div>
<div style="background-color:purple" onclick="add()"> click to add popup to map</div>
<div style="background-color:blue" onclick="changer()"> click to get lon/lat for pixel point(0,0)</div>
<div style="background-color:red" onclick="destroy()"> click to destroy the popup</div>
<div style="background-color:green" onclick="remove()"> click to remove the popup from map</div>
</body>
</html>

58
examples/mm.html Normal file
View File

@@ -0,0 +1,58 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 100%;
height: 512px;
border: 1px solid black;
}
</style>
<script type="text/javascript" src="http://clients.multimap.com/API/maps/1.1/metacarta_04"></script>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
<!--
var lon = 5;
var lat = 40;
var zoom = 5;
var map, mmlayer, layer;
function init(){
map = new OpenLayers.Map( $('map') ,
{controls:[new OpenLayers.Control.MouseDefaults()]});
mmlayer = new OpenLayers.Layer.MultiMap( "MultiMap");
map.addLayer(mmlayer);
markers = new OpenLayers.Layer.Markers("markers");
map.addLayer(markers);
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
map.addControl( new OpenLayers.Control.LayerSwitcher() );
map.addControl( new OpenLayers.Control.PanZoomBar() );
}
function add() {
marker = new OpenLayers.Marker(new OpenLayers.LonLat(2, 41));
markers.addMarker(marker);
}
function remove() {
markers.removeMarker(marker);
}
// -->
</script>
</head>
<body onload="init()">
<h1>OpenLayers MultiMap Example</h1>
<div id="map"></div>
<div style="background-color:green" onclick="add()"> click to add the marker to the map</div>
<div style="background-color:red" onclick="remove()"> click to remove the marker from the map</div>
</body>
</html>

View File

@@ -11,45 +11,25 @@
-->
<head>
<script src="../lib/OpenLayers.js"></script>
<!-- this gmaps key generated for http://openlayers.org/dev/ -->
<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA9XNhd8q0UdwNC7YSO4YZghSPUCi5aRYVveCcVYxzezM4iaj_gxQ9t-UajFL70jfcpquH5l1IJ-Zyyw'></script>
<!-- Localhost key -->
<!--<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTS6gjckBmeABOGXIUiOiZObZESPg'></script>-->
<script src="http://openlayers.org/dev/lib/OpenLayers.js"></script>
<script>
// From:
// <http://www.oreilly.com/catalog/jscript3/chapter/ch13.html#JSCRIPT-CH-WINDOWS-EX-LOC>
/*
* This function parses comma-separated name=value argument pairs from
* the query string of the URL. It stores the name=value pairs in
* properties of an object and returns that object.
*/
// +pjl changed to split on ampersand, not comma.
function getArgs() {
var args = new Object();
var query = location.search.substring(1); // Get query string.
var pairs = query.split("&"); // Break at ampersand. //+pjl
for(var i = 0; i < pairs.length; i++) {
var pos = pairs[i].indexOf('='); // Look for "name=value".
if (pos == -1) continue; // If not found, skip.
var argname = pairs[i].substring(0,pos); // Extract the name.
var value = pairs[i].substring(pos+1); // Extract the value.
args[argname] = unescape(value); // Store as a property.
}
return args; // Return the object.
}
function runMVS() {
OpenLayers.ProxyHost = '/proxy/?url=';
if (document.location.protocol != "file:") {
theArgs = getArgs();
theArgs = OpenLayers.Util.getArgs();
} else {
theArgs = {};
theArgs.center = "0,0";
theArgs.zoom = "0";
theArgs.data = "textfile.txt";
theArgs.controls = ['panzoom','mouse'];
theArgs.layers = ['openlayers', 'nasa'];
theArgs.controls = 'panzoom,mouse';
theArgs.layers = 'openlayers';
}
@@ -61,7 +41,7 @@ function runMVS() {
var DEFAULT_LON = 0;
var DEFAULT_ZOOM_LEVEL = 0;
var DEFAULT_CONTROLS = ['panzoom','mouse'];
var DEFAULT_LAYERS = ['openlayers', 'nasa'];
var DEFAULT_LAYERS = ['openlayers'];
var IDX_LAT = 0;
var IDX_LON = 1;
@@ -77,16 +57,14 @@ function runMVS() {
safeArgs.controls = theArgs.controls ?
theArgs.controls.split(",") : DEFAULT_CONTROLS;
safeArgs.controls = theArgs.controls ?
theArgs.controls.split(",") : DEFAULT_CONTROLS;
safeArgs.layers = theArgs.layers ?
theArgs.layers.split(",") : DEFAULT_LAYERS;
safeArgs.data = theArgs.data; // TODO: Make this "safe".
safeArgs.marker = theArgs.marker; // TODO: Make this "safe".
// -----
var theMVS = new OpenLayers.Map($('map'), {controls: []});
var theMVS = new OpenLayers.Map($('map'), {controls: [], maxResolution: 'auto'});
for(var i = 0; i < safeArgs.controls.length; i++) {
switch(safeArgs.controls[i]) {
case 'panzoombar':
@@ -121,12 +99,22 @@ function runMVS() {
layers:"modis,global_mosaic"}
));
break;
case 'gmaps':
theMVS.addLayer(
new OpenLayers.Layer.Google( "Google" , {type: G_HYBRID_MAP })
);
break;
}
}
theMVS.setCenter(new OpenLayers.LonLat(safeArgs.centerLon, safeArgs.centerLat), safeArgs.zoom);
if (safeArgs.marker) {
var m = new OpenLayers.Layer.Markers("Marker");
m.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(safeArgs.centerLon, safeArgs.centerLat)));
theMVS.addLayer(m);
}
if (safeArgs.data) {
theMVS.addLayer(new OpenLayers.Layer.Text("Data", safeArgs.data));
theMVS.addLayer(new OpenLayers.Layer.Text("Data", {location: safeArgs.data}));
}
}

View File

@@ -2,8 +2,8 @@
<head>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -11,11 +11,11 @@
<script type="text/javascript">
<!--
function init(){
var map = new OpenLayers.Map('map');
var map = new OpenLayers.Map('map', {maxResolution: 'auto'});
var ol_wms = new OpenLayers.Layer.WMS.Untiled( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
ol_wms.isBaseLayer = true;
map.addLayers([ol_wms]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(0, 0), 0);

View File

@@ -0,0 +1,36 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 800px;
height: 475px;
border: 1px solid black;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
<!--
var zoom = 5;
var map, layer;
function init(){
map = new OpenLayers.Map( $('map') );
layer = new OpenLayers.Layer.WMS( "OpenStreetMap WMS",
"http://tile.openstreetmap.org/ruby/wmsmod.rbx?" );
layer.setTileSize(new OpenLayers.Size(256,128));
map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(-0.02197265625,51.492919921875), 13);
map.addControl( new OpenLayers.Control.LayerSwitcher() );
}
// -->
</script>
</head>
<body onload="init()">
<div id="map"></div>
</body>
</html>

View File

@@ -3,8 +3,8 @@
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -20,16 +20,11 @@
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(layer);
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS2",
"http://octo.metacarta.com/cgi-bin/mapserv",
{map: '/mapdata/vmap_wms.map', layers: 'basic', format: 'image/jpeg'} );
map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToMaxExtent();
}
function changer() {
popup.setBackgroundColor("red");
popup.setSize(new OpenLayers.Size(100,600));
@@ -76,9 +71,9 @@
function mousedown(evt) {
if (popup == null) {
popup = feature.createPopup();
popup.setContentHTML("<a href='http://www.somethingconstructive.net' target='_blank'>click me</a>");
popup.setBackgroundColor("yellow");
popup.setOpacity(0.7);
popup.events.register("mousedown", popup, onPopupMouseDown);
markers.map.addPopup(popup);
} else {
markers.map.removePopup(popup);
@@ -124,6 +119,6 @@
<div style="background-color:red" onclick="remove()"> click to remove the popup from map</div>
<div style="background-color:grey" onclick="removelayer()"> click to remove the markers layer</div>
<div style="background-color:orange" onclick="alert(marker.onScreen())"> marker.onscreen()?</div>
<div style="background-color:yellow" onclick="destroy()"> click to destroy the popup from map</div>
<div style="background-color:yellow" onclick="destroy()"> click to destroy the popup from map</div>
</body>
</html>

29
examples/setextent.html Normal file
View File

@@ -0,0 +1,29 @@
<html>
<head>
<title>Setting a visual Extent</title>
<script src="../lib/OpenLayers.js"></script>
</head>
<body>
<h1>Setting a Visual Extent</h1>
<p>
Because the ability to set the map to a given extent is limited by the
current resolutions available, zoomToExtent will not always set the map to
exactly the right extent. In order to visually annotate the actual extent,
this example, will use the Boxes layer to visually describe the desired
extent as well as setting the map extent.
</p>
<div style="width:100%; height:75%" id="map"></div>
<script defer="defer" type="text/javascript">
var map = new OpenLayers.Map('map');
var bounds = new OpenLayers.Bounds(-45,-45, 0, 45);
var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(wms);
map.zoomToExtent(bounds);
var boxes = new OpenLayers.Layer.Boxes("boxes");
var box = new OpenLayers.Marker.Box(bounds);
boxes.addMarker(box);
map.addLayer(boxes);
</script>
</body>
</html>

View File

@@ -2,8 +2,8 @@
<head>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 700px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -11,15 +11,20 @@
<script type="text/javascript">
<!--
function init(){
var map = new OpenLayers.Map('map', {'maxResolution': 1.2/4, controls:[]});
var map = new OpenLayers.Map('map', {'maxResolution': 1.40625/4, controls:[]});
var ka_wms = new OpenLayers.Layer.KaMap( "KaMap", "http://maps.dmsolutions.ca/demo/us_streets/tile.php", {map:'tiger04', g:'__base__'}, new OpenLayers.LonLat(0,0));
ka_wms.setTileSize(new OpenLayers.Size(300,300));
map.addLayers([ka_wms]); // , ka_wms, kamap_wms]);
var ka_wms = new OpenLayers.Layer.KaMap( "TIGER (KaMap)",
"http://boston.freemap.in/tile.php" , { map: 'tiger', layers: 'TIGER' });
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
"http://wms.jpl.nasa.gov/wms.cgi",
{layers: "modis,global_mosaic"});
jpl_wms.setVisibility(false);
ka_wms.isBaseLayer = false;
map.addLayers([jpl_wms,ka_wms]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addControl(new OpenLayers.Control.MouseToolbar());
map.addControl(new OpenLayers.Control.PanZoomBar());
map.setCenter(new OpenLayers.LonLat(-70, 30), 2);
map.setCenter(new OpenLayers.LonLat(-96, 35), 2);
}
// -->
</script>

36
examples/urban.html Normal file
View File

@@ -0,0 +1,36 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
#map {
width: 800px;
height: 475px;
border: 1px solid black;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
<!--
function init(){
var mapOptions = { maxResolution: 1.6, numZoomLevels: 21};
var map = new OpenLayers.Map('map', mapOptions);
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
var ww = new OpenLayers.Layer.WorldWind( "Urban",
"http://worldwind25.arc.nasa.gov/tile/tile.aspx?", .8, 9,
{T:"104"}, { tileSize: new OpenLayers.Size(512,512) });
map.addLayers([ol_wms, ww]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(-71.4, 42.3), 6);
}
// -->
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<div id="map"></div>
</body>
</html>

View File

@@ -3,36 +3,56 @@
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 100%;
height: 512px;
border: 1px solid black;
}
</style>
<script src='http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js'></script>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
<!--
var map, layer, velayer;
var lon = 5;
var lat = 40;
var zoom = 15;
var map, velayer, layer;
function init(){
map = new OpenLayers.Map('map');
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(layer);
velayer = new OpenLayers.Layer.VirtualEarth( "VE");
map = new OpenLayers.Map( $('map') ,
{controls:[new OpenLayers.Control.MouseDefaults()]});
velayer = new OpenLayers.Layer.VirtualEarth( "VE",
{ minZoomLevel: 4, maxZoomLevel: 6 });
map.addLayer(velayer);
markers = new OpenLayers.Layer.Markers("markers");
map.addLayer(markers);
map.setCenter(new OpenLayers.LonLat(-5, 40), 4);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
map.addControl( new OpenLayers.Control.LayerSwitcher() );
map.addControl( new OpenLayers.Control.PanZoomBar() );
}
// -->
function add() {
marker = new OpenLayers.Marker(new OpenLayers.LonLat(2, 41));
markers.addMarker(marker);
}
function remove() {
markers.removeMarker(marker);
}
// -->
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<h1>OpenLayers VE Example</h1>
<div id="map"></div>
<div style="background-color:green" onclick="add()"> click to add the marker to the map</div>
<div style="background-color:red" onclick="remove()"> click to remove the marker from the map</div>
</body>
</html>

View File

@@ -3,8 +3,8 @@
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -14,20 +14,19 @@
var map, layer;
function init(){
OpenLayers.ProxyHost = '/dev/examples/proxy.cgi?url=';
OpenLayers.ProxyHost="/proxy/?url=";
map = new OpenLayers.Map('map');
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(layer);
layer = new OpenLayers.Layer.WFS( "OpenLayers WFS",
"http://labs.metacarta.com/search/WFS?",
{q: 'dolphins', maxfeatures: 10} );
layer = new OpenLayers.Layer.WFS( "Owl Survey",
"http://www.bsc-eoc.org/cgi-bin/bsc_ows.asp?",
{typename: "OWLS", maxfeatures: 10},
{ featureClass: OpenLayers.Feature.WFS});
map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(-100, 60), 3);
}
// -->
</script>

35
examples/wms.html Normal file
View File

@@ -0,0 +1,35 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 800px;
height: 475px;
border: 1px solid black;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
<!--
var lon = 5;
var lat = 40;
var zoom = 5;
var map, layer;
function init(){
map = new OpenLayers.Map( $('map') );
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
map.addControl( new OpenLayers.Control.LayerSwitcher() );
}
// -->
</script>
</head>
<body onload="init()">
<div id="map"></div>
</body>
</html>

42
examples/wmst.html Normal file
View File

@@ -0,0 +1,42 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
#map {
width: 512px;
height: 400px;
border: 1px solid black;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
<!--
var map,ia_wms;
function init(){
map = new OpenLayers.Map('map');
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
"http://wms.jpl.nasa.gov/wms.cgi",
{layers: "modis,global_mosaic"});
ia_wms = new OpenLayers.Layer.WMS("Nexrad","http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?",{layers:"nexrad-n0r-wmst",transparent:true,format:'image/png',time:document.getElementById('time').value});
jpl_wms.setVisibility(false);
map.addLayers([ol_wms, jpl_wms, ia_wms]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToMaxExtent();
}
// -->
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<p>WMS-T example: update the times, and the radar image will change. Uses Layer.changeParams. Thanks to David Bitner for the inspiration, the original code, and the kick in the butt!</p>
<input type='text' id='time' value="2005-08-29T13:00:00Z" onChange='ia_wms.mergeNewParams({"time":this.value});' >
<div id="map"></div>
</body>
</html>

41
examples/worldwind.html Normal file
View File

@@ -0,0 +1,41 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
#map {
width: 800px;
height: 475px;
border: 1px solid black;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
<!--
function init(){
var map = new OpenLayers.Map('map', {'maxResolution': .0703125*4});
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
var ww = new OpenLayers.Layer.WorldWind( "Bathy",
"http://worldwind25.arc.nasa.gov/tile/tile.aspx?", 36, 4,
{T:"bmng.topo.bathy.200406"});
ww.setTileSize(new OpenLayers.Size(512,512));
var ww2 = new OpenLayers.Layer.WorldWind( "LANDSAT",
"http://worldwind25.arc.nasa.gov/tile/tile.aspx", 2.25, 4,
{T:"105"});
ww2.setTileSize(new OpenLayers.Size(512,512));
map.addLayers([ol_wms, ww, ww2]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(-71.4, 42.3), 6);
}
// -->
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<div id="map"></div>
</body>
</html>

23
examples/xhtml.html Normal file
View File

@@ -0,0 +1,23 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>XHTML Example</title>
<script src="../lib/OpenLayers.js" type="text/javascript"></script>
</head>
<body style="width:100%">
<div style="width:100%; height:500px" id="map"></div>
<script defer="defer" type="text/javascript">
var map = new OpenLayers.Map('map');
var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(wms);
map.zoomToMaxExtent();
</script>
<p>
<a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0!" height="31" width="88" /></a>
</p>
</body>
</html>

View File

@@ -1,38 +1,39 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 800px;
height: 475px;
border: 1px solid black;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
<!--
var map, layer, velayer;
function init(){
map = new OpenLayers.Map('map');
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(layer);
yahooLayer = new OpenLayers.Layer.Yahoo( "Yahoo");
map.addLayer(yahooLayer);
map.setCenter(new OpenLayers.LonLat(-5, 40), 4);
map.addControl(new OpenLayers.Control.LayerSwitcher());
}
// -->
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<div id="map"></div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<script src="http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers"></script>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
<!--
var map, layer, velayer;
function init(){
map = new OpenLayers.Map('map');
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(layer);
yahooLayer = new OpenLayers.Layer.Yahoo( "Yahoo");
map.addLayer(yahooLayer);
map.setCenter(new OpenLayers.LonLat(-5, 40), 4);
map.addControl(new OpenLayers.Control.LayerSwitcher());
}
// -->
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<div id="map"></div>
</body>
</html>

54
examples/zoomLevels.html Normal file
View File

@@ -0,0 +1,54 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 800px;
height: 475px;
border: 1px solid black;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
<!--
var lon = 50;
var lat = 0;
var zoom = 0;
var map, layer;
function init(){
var options = {
// resolutions: [1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.00137329101],
// scales: [50000000, 10000000],
// maxResolution: 0.17578125,
// minResolution: 0.0439453125,
// maxScale: 10000000,
// minScale: 50000000,
minResolution: "auto",
minExtent: new OpenLayers.Bounds(-1, -1, 1, 1),
maxResolution: "auto",
maxExtent: new OpenLayers.Bounds(-180, -90, 90, 180),
// numZoomLevels: 5,
controls: [new OpenLayers.Control.MouseDefaults()]
};
map = new OpenLayers.Map( $('map') , options);
map.addControl(new OpenLayers.Control.PanZoomBar());
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'});
map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
}
// -->
</script>
</head>
<body onload="init()">
<div id="map"></div>
</body>
</html>

BIN
img/blank.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

View File

@@ -6,7 +6,11 @@
///
OpenLayers = new Object();
OpenLayers._scriptName = "lib/OpenLayers.js";
OpenLayers._scriptName = (
typeof(_OPENLAYERS_SFL_) == "undefined" ? "lib/OpenLayers.js"
: "OpenLayers.js" );
OpenLayers._getScriptLocation = function () {
var scriptLocation = "";
var SCRIPT_NAME = OpenLayers._scriptName;
@@ -47,6 +51,7 @@ if (typeof(_OPENLAYERS_SFL_) == "undefined") {
"Prototype.js",
"Rico/Corner.js",
"Rico/Color.js",
"OpenLayers/BaseTypes.js",
"OpenLayers/Util.js",
"OpenLayers/Ajax.js",
"OpenLayers/Events.js",
@@ -54,22 +59,31 @@ if (typeof(_OPENLAYERS_SFL_) == "undefined") {
"OpenLayers/Layer.js",
"OpenLayers/Icon.js",
"OpenLayers/Marker.js",
"OpenLayers/Marker/Box.js",
"OpenLayers/Popup.js",
"OpenLayers/Tile.js",
"OpenLayers/Feature.js",
"OpenLayers/Feature/WFS.js",
"OpenLayers/Tile/Image.js",
"OpenLayers/Tile/WFS.js",
// "OpenLayers/Layer/Google.js",
// "OpenLayers/Layer/VirtualEarth.js",
// "OpenLayers/Layer/Yahoo.js",
"OpenLayers/Layer/EventPane.js",
"OpenLayers/Layer/FixedZoomLevels.js",
"OpenLayers/Layer/Google.js",
"OpenLayers/Layer/VirtualEarth.js",
"OpenLayers/Layer/Yahoo.js",
"OpenLayers/Layer/HTTPRequest.js",
"OpenLayers/Layer/Grid.js",
"OpenLayers/Layer/KaMap.js",
"OpenLayers/Layer/MultiMap.js",
"OpenLayers/Layer/Markers.js",
"OpenLayers/Layer/Text.js",
"OpenLayers/Layer/WorldWind.js",
"OpenLayers/Layer/WMS.js",
"OpenLayers/Layer/WFS.js",
"OpenLayers/Layer/WMS/Untiled.js",
"OpenLayers/Layer/GeoRSS.js",
"OpenLayers/Layer/Boxes.js",
"OpenLayers/Layer/Canvas.js",
"OpenLayers/Popup/Anchored.js",
"OpenLayers/Popup/AnchoredBubble.js",
"OpenLayers/Control.js",
@@ -78,7 +92,10 @@ if (typeof(_OPENLAYERS_SFL_) == "undefined") {
"OpenLayers/Control/KeyboardDefaults.js",
"OpenLayers/Control/PanZoom.js",
"OpenLayers/Control/PanZoomBar.js",
"OpenLayers/Control/LayerSwitcher.js"
"OpenLayers/Control/Permalink.js",
"OpenLayers/Control/Scale.js",
"OpenLayers/Control/LayerSwitcher.js",
"OpenLayers/Control/LayerTabs.js"
); // etc.
var allScriptTags = "";

View File

@@ -1,113 +1,108 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
* text of the license. */
OpenLayers.ProxyHost = "/viewer/Crossbrowser/blindproxy.py?url=";
//OpenLayers.ProxyHost = "examples/proxy.cgi?url=";
/**
* Ajax reader for OpenLayers
*
*@uri url to do remote XML http get
*@param 'get' format params (x=y&a=b...)
*@who object to handle callbacks for this request
*@complete the function to be called on success
*@failure the function to be called on failure
*
* example usage from a caller:
*
* caps: function(request) {
* -blah-
* },
*
* OpenLayers.loadURL(url,params,this,caps);
*
* Notice the above example does not provide an error handler; a default empty
* handler is provided which merely logs the error if a failure handler is not
* supplied
*
*/
/**
* @param {} request
*/
OpenLayers.nullHandler = function(request) {
alert("Unhandled request return " + request.statusText);
};
/** Background load a document
*
* @param {String} uri URI of source doc
* @param {String} params Params on get (doesnt seem to work)
* @param {Object} caller object which gets callbacks
* @param {Function} onComplete callback for success
* @param {Function} onFailure callback for failure
*
* Both callbacks optional (though silly)
*/
OpenLayers.loadURL = function(uri, params, caller,
onComplete, onFailure) {
if (OpenLayers.ProxyHost && uri.startsWith("http")) {
uri = OpenLayers.ProxyHost + escape(uri);
if (!params) {
params="";
}
params += "&cachehack=" + new Date().getTime();
}
var success = (onComplete) ? onComplete.bind(caller)
: OpenLayers.nullHandler;
var failure = (onFailure) ? onFailure.bind(caller)
: OpenLayers.nullHandler;
// from prototype.js
new Ajax.Request(uri,
{ method: 'get',
parameters: params,
onComplete: success,
onFailure: failure
}
);
};
/** Parse XML into a doc structure
* @param {String} text
*
* @returns Parsed Ajax Response ??
* @type ?
*/
OpenLayers.parseXMLString = function(text) {
//MS sucks, if the server is bad it dies
var index = text.indexOf('<');
if (index > 0) {
text = text.substring(index);
}
var ajaxResponse = Try.these(
function() {
var xmldom = new ActiveXObject('Microsoft.XMLDOM');
xmldom.loadXML(text);
return xmldom;
},
function() {
return new DOMParser().parseFromString(text, 'text/xml');
},
function() {
var req = new XMLHttpRequest();
req.open("GET", "data:" + "text/xml" +
";charset=utf-8," + encodeURIComponent(text), false);
if (req.overrideMimeType) {
req.overrideMimeType("text/xml");
}
req.send(null);
return req.responseXML;
}
);
return ajaxResponse;
};
OpenLayers.ProxyHost = "";
//OpenLayers.ProxyHost = "examples/proxy.cgi?url=";
/**
* Ajax reader for OpenLayers
*
*@uri url to do remote XML http get
*@param 'get' format params (x=y&a=b...)
*@who object to handle callbacks for this request
*@complete the function to be called on success
*@failure the function to be called on failure
*
* example usage from a caller:
*
* caps: function(request) {
* -blah-
* },
*
* OpenLayers.loadURL(url,params,this,caps);
*
* Notice the above example does not provide an error handler; a default empty
* handler is provided which merely logs the error if a failure handler is not
* supplied
*
*/
/**
* @param {} request
*/
OpenLayers.nullHandler = function(request) {
alert("Unhandled request return " + request.statusText);
};
/** Background load a document
*
* @param {String} uri URI of source doc
* @param {String} params Params on get (doesnt seem to work)
* @param {Object} caller object which gets callbacks
* @param {Function} onComplete callback for success
* @param {Function} onFailure callback for failure
*
* Both callbacks optional (though silly)
*/
OpenLayers.loadURL = function(uri, params, caller,
onComplete, onFailure) {
if (OpenLayers.ProxyHost && uri.startsWith("http")) {
uri = OpenLayers.ProxyHost + escape(uri);
}
var success = (onComplete) ? onComplete.bind(caller)
: OpenLayers.nullHandler;
var failure = (onFailure) ? onFailure.bind(caller)
: OpenLayers.nullHandler;
// from prototype.js
new Ajax.Request(uri,
{ method: 'get',
parameters: params,
onComplete: success,
onFailure: failure
}
);
};
/** Parse XML into a doc structure
* @param {String} text
*
* @returns Parsed Ajax Response ??
* @type ?
*/
OpenLayers.parseXMLString = function(text) {
//MS sucks, if the server is bad it dies
var index = text.indexOf('<');
if (index > 0) {
text = text.substring(index);
}
var ajaxResponse = Try.these(
function() {
var xmldom = new ActiveXObject('Microsoft.XMLDOM');
xmldom.loadXML(text);
return xmldom;
},
function() {
return new DOMParser().parseFromString(text, 'text/xml');
},
function() {
var req = new XMLHttpRequest();
req.open("GET", "data:" + "text/xml" +
";charset=utf-8," + encodeURIComponent(text), false);
if (req.overrideMimeType) {
req.overrideMimeType("text/xml");
}
req.send(null);
return req.responseXML;
}
);
return ajaxResponse;
};

708
lib/OpenLayers/BaseTypes.js Normal file
View File

@@ -0,0 +1,708 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
* text of the license. */
/*********************
* *
* PIXEL *
* *
*********************/
/**
* @class
*
* This class represents a screen coordinate, in x and y coordinates
*/
OpenLayers.Pixel = Class.create();
OpenLayers.Pixel.prototype = {
/** @type float */
x: 0.0,
/** @type float */
y: 0.0,
/**
* @constructor
*
* @param {float} x
* @param {float} y
*/
initialize: function(x, y) {
this.x = parseFloat(x);
this.y = parseFloat(y);
},
/**
* @return string representation of Pixel. ex: "x=200.4,y=242.2"
* @type str
*/
toString:function() {
return ("x=" + this.x + ",y=" + this.y);
},
/**
* @type OpenLayers.Pixel
*/
clone:function() {
return new OpenLayers.Pixel(this.x, this.y);
},
/**
* @param {OpenLayers.Pixel} px
*
* @return whether or not the point passed in as parameter is equal to this
* note that if px passed in is null, returns false
* @type bool
*/
equals:function(px) {
var equals = false;
if (px != null) {
equals = ((this.x == px.x && this.y == px.y) ||
(isNaN(this.x) && isNaN(this.y) && isNaN(px.x) && isNaN(px.y)));
}
return equals;
},
/**
* @param {int} x
* @param {int} y
*
* @return a new Pixel with this pixel's x&y augmented by the
* values passed in.
* @type OpenLayers.Pixel
*/
add:function(x, y) {
return new OpenLayers.Pixel(this.x + x, this.y + y);
},
/**
* @param {OpenLayers.Pixel} px
*
* @return a new Pixel with this pixel's x&y augmented by the
* x&y values of the pixel passed in.
* @type OpenLayers.Pixel
*/
offset:function(px) {
return this.add(px.x, px.y);
},
/** @final @type str */
CLASS_NAME: "OpenLayers.Pixel"
};
/*********************
* *
* SIZE *
* *
*********************/
/**
* @class
*
* This class represents a width and height pair
*/
OpenLayers.Size = Class.create();
OpenLayers.Size.prototype = {
/** @type float */
w: 0.0,
/** @type float */
h: 0.0,
/**
* @constructor
*
* @param {float} w
* @param {float} h
*/
initialize: function(w, h) {
this.w = parseFloat(w);
this.h = parseFloat(h);
},
/**
* @return String representation of OpenLayers.Size object.
* (ex. <i>"w=55,h=66"</i>)
* @type String
*/
toString:function() {
return ("w=" + this.w + ",h=" + this.h);
},
/**
* @return New OpenLayers.Size object with the same w and h values
* @type OpenLayers.Size
*/
clone:function() {
return new OpenLayers.Size(this.w, this.h);
},
/**
* @param {OpenLayers.Size} sz
* @returns Boolean value indicating whether the passed-in OpenLayers.Size
* object has the same w and h components as this
* note that if sz passed in is null, returns false
*
* @type bool
*/
equals:function(sz) {
var equals = false;
if (sz != null) {
equals = ((this.w == sz.w && this.h == sz.h) ||
(isNaN(this.w) && isNaN(this.h) && isNaN(sz.w) && isNaN(sz.h)));
}
return equals;
},
/** @final @type String */
CLASS_NAME: "OpenLayers.Size"
};
/*********************
* *
* LONLAT *
* *
*********************/
/**
* @class
*
* This class represents a longitude and latitude pair
*/
OpenLayers.LonLat = Class.create();
OpenLayers.LonLat.prototype = {
/** @type float */
lon: 0.0,
/** @type float */
lat: 0.0,
/**
* @constructor
*
* @param {float} lon
* @param {float} lat
*/
initialize: function(lon, lat) {
this.lon = parseFloat(lon);
this.lat = parseFloat(lat);
},
/**
* @return String representation of OpenLayers.LonLat object.
* (ex. <i>"lon=5,lat=42"</i>)
* @type String
*/
toString:function() {
return ("lon=" + this.lon + ",lat=" + this.lat);
},
/**
* @return Shortened String representation of OpenLayers.LonLat object.
* (ex. <i>"5, 42"</i>)
* @type String
*/
toShortString:function() {
return (this.lon + ", " + this.lat);
},
/**
* @return New OpenLayers.LonLat object with the same lon and lat values
* @type OpenLayers.LonLat
*/
clone:function() {
return new OpenLayers.LonLat(this.lon, this.lat);
},
/**
* @param {float} lon
* @param {float} lat
*
* @return A new OpenLayers.LonLat object with the lon and lat passed-in
* added to this's.
* @type OpenLayers.LonLat
*/
add:function(lon, lat) {
return new OpenLayers.LonLat(this.lon + lon, this.lat + lat);
},
/**
* @param {OpenLayers.LonLat} ll
* @returns Boolean value indicating whether the passed-in OpenLayers.LonLat
* object has the same lon and lat components as this
* note that if ll passed in is null, returns false
*
* @type bool
*/
equals:function(ll) {
var equals = false;
if (ll != null) {
equals = ((this.lon == ll.lon && this.lat == ll.lat) ||
(isNaN(this.lon) && isNaN(this.lat) && isNaN(ll.lon) && isNaN(ll.lat)));
}
return equals;
},
/** @final @type String */
CLASS_NAME: "OpenLayers.LonLat"
};
/** Alternative constructor that builds a new OpenLayers.LonLat from a
* parameter string
*
* @constructor
*
* @param {String} str Comma-separated Lon,Lat coordinate string.
* (ex. <i>"5,40"</i>)
*
* @returns New OpenLayers.LonLat object built from the passed-in String.
* @type OpenLayers.LonLat
*/
OpenLayers.LonLat.fromString = function(str) {
var pair = str.split(",");
return new OpenLayers.LonLat(parseFloat(pair[0]),
parseFloat(pair[1]));
};
/*********************
* *
* BOUNDS *
* *
*********************/
/**
* @class
*
* This class represents a bounding box.
* Data stored as left, bottom, right, top floats
*/
OpenLayers.Bounds = Class.create();
OpenLayers.Bounds.prototype = {
/** @type float */
left: 0.0,
/** @type float */
bottom: 0.0,
/** @type float */
right: 0.0,
/** @type float */
top: 0.0,
/**
* @constructor
*
* @param {float} left
* @param {float} bottom
* @param {float} right
* @param {float} top
*
*/
initialize: function(left, bottom, right, top) {
this.left = parseFloat(left);
this.bottom = parseFloat(bottom);
this.right = parseFloat(right);
this.top = parseFloat(top);
},
/**
* @returns A fresh copy of the bounds
* @type OpenLayers.Bounds
*/
clone:function() {
return new OpenLayers.Bounds(this.left, this.bottom,
this.right, this.top);
},
/**
* @param {OpenLayers.Bounds} bounds
* @returns Boolean value indicating whether the passed-in OpenLayers.Bounds
* object has the same left, right, top, bottom components as this
* note that if bounds passed in is null, returns false
*
* @type bool
*/
equals:function(bounds) {
var equals = false;
if (bounds != null) {
equals = ((this.left == bounds.left) &&
(this.right == bounds.right) &&
(this.top == bounds.top) &&
(this.bottom == bounds.bottom));
}
return equals;
},
/**
* @return String representation of OpenLayers.Bounds object.
* (ex.<i>"left-bottom=(5,42) right-top=(10,45)"</i>)
* @type String
*/
toString:function(){
return ( "left-bottom=(" + this.left + "," + this.bottom + ")"
+ " right-top=(" + this.right + "," + this.top + ")" );
},
/**
* @return Simple String representation of OpenLayers.Bounds object.
* (ex. <i>"5,42,10,45"</i>)
* @type String
*/
toBBOX:function() {
return (this.left + "," + this.bottom + ","
+ this.right + "," + this.top);
},
/**
* @returns The width of the bounds
* @type float
*/
getWidth:function() {
return (this.right - this.left);
},
/**
* @returns The height of the bounds
* @type float
*/
getHeight:function() {
return (this.top - this.bottom);
},
/**
* @returns An OpenLayers.Size which represents the size of the box
* @type OpenLayers.Size
*/
getSize:function() {
return new OpenLayers.Size(this.getWidth(), this.getHeight());
},
/**
* @returns An OpenLayers.Pixel which represents the center of the bounds
* @type OpenLayers.Pixel
*/
getCenterPixel:function() {
return new OpenLayers.Pixel( (this.left + this.right) / 2,
(this.bottom + this.top) / 2);
},
/**
* @returns An OpenLayers.LonLat which represents the center of the bounds
* @type OpenLayers.LonLat
*/
getCenterLonLat:function() {
return new OpenLayers.LonLat( (this.left + this.right) / 2,
(this.bottom + this.top) / 2);
},
/**
* @param {float} x
* @param {float} y
*
* @returns A new OpenLayers.Bounds whose coordinates are the same as this,
* but shifted by the passed-in x and y values
* @type OpenLayers.Bounds
*/
add:function(x, y){
return new OpenLayers.Bounds(this.left + x, this.bottom + y,
this.right + x, this.top + y);
},
/**
* @param {float} x
* @param {float} y
* @param {Boolean} inclusive Whether or not to include the border.
* Default is true
*
* @return Whether or not the passed-in coordinates are within this bounds
* @type Boolean
*/
contains:function(x, y, inclusive) {
//set default
if (inclusive == null) {
inclusive = true;
}
var contains = false;
if (inclusive) {
contains = ((x >= this.left) && (x <= this.right) &&
(y >= this.bottom) && (y <= this.top));
} else {
contains = ((x > this.left) && (x < this.right) &&
(y > this.bottom) && (y < this.top));
}
return contains;
},
/**
* @param {OpenLayers.Bounds} bounds
* @param {Boolean} partial If true, only part of passed-in
* OpenLayers.Bounds needs be within this bounds.
* If false, the entire passed-in bounds must be
* within. Default is false
* @param {Boolean} inclusive Whether or not to include the border.
* Default is true
*
* @return Whether or not the passed-in OpenLayers.Bounds object is
* contained within this bounds.
* @type Boolean
*/
containsBounds:function(bounds, partial, inclusive) {
//set defaults
if (partial == null) {
partial = false;
}
if (inclusive == null) {
inclusive = true;
}
var inLeft;
var inTop;
var inRight;
var inBottom;
if (inclusive) {
inLeft = (bounds.left >= this.left) && (bounds.left <= this.right);
inTop = (bounds.top >= this.bottom) && (bounds.top <= this.top);
inRight= (bounds.right >= this.left) && (bounds.right <= this.right);
inBottom = (bounds.bottom >= this.bottom) && (bounds.bottom <= this.top);
} else {
inLeft = (bounds.left > this.left) && (bounds.left < this.right);
inTop = (bounds.top > this.bottom) && (bounds.top < this.top);
inRight= (bounds.right > this.left) && (bounds.right < this.right);
inBottom = (bounds.bottom > this.bottom) && (bounds.bottom < this.top);
}
return (partial) ? (inTop || inBottom) && (inLeft || inRight )
: (inTop && inLeft && inBottom && inRight);
},
/**
* @param {OpenLayers.LonLat} lonlat
*
* @returns The quadrant ("br" "tr" "tl" "bl") of the bounds in which
* the coordinate lies.
* @type String
*/
determineQuadrant: function(lonlat) {
var quadrant = "";
var center = this.getCenterLonLat();
quadrant += (lonlat.lat < center.lat) ? "b" : "t";
quadrant += (lonlat.lon < center.lon) ? "l" : "r";
return quadrant;
},
/** @final @type String */
CLASS_NAME: "OpenLayers.Bounds"
};
/** Alternative constructor that builds a new OpenLayers.Bounds from a
* parameter string
*
* @constructor
*
* @param {String} str Comma-separated bounds string. (ex. <i>"5,42,10,45"</i>)
*
* @returns New OpenLayers.Bounds object built from the passed-in String.
* @type OpenLayers.Bounds
*/
OpenLayers.Bounds.fromString = function(str) {
var bounds = str.split(",");
return OpenLayers.Bounds.fromArray(bounds);
};
/** Alternative constructor that builds a new OpenLayers.Bounds
* from an array
*
* @constructor
*
* @param {Array} bbox Array of bounds values (ex. <i>[5,42,10,45]</i>)
*
* @returns New OpenLayers.Bounds object built from the passed-in Array.
* @type OpenLayers.Bounds
*/
OpenLayers.Bounds.fromArray = function(bbox) {
return new OpenLayers.Bounds(parseFloat(bbox[0]),
parseFloat(bbox[1]),
parseFloat(bbox[2]),
parseFloat(bbox[3]));
};
/** Alternative constructor that builds a new OpenLayers.Bounds
* from an OpenLayers.Size
*
* @constructor
*
* @param {OpenLayers.Size} size
*
* @returns New OpenLayers.Bounds object built with top and left set to 0 and
* bottom right taken from the passed-in OpenLayers.Size.
* @type OpenLayers.Bounds
*/
OpenLayers.Bounds.fromSize = function(size) {
return new OpenLayers.Bounds(0,
size.h,
size.w,
0);
};
/**
* @param {String} quadrant
*
* @returns The opposing quadrant ("br" "tr" "tl" "bl"). For Example, if
* you pass in "bl" it returns "tr", if you pass in "br" it
* returns "tl", etc.
* @type String
*/
OpenLayers.Bounds.oppositeQuadrant = function(quadrant) {
var opp = "";
opp += (quadrant.charAt(0) == 't') ? 'b' : 't';
opp += (quadrant.charAt(1) == 'l') ? 'r' : 'l';
return opp;
};
/*********************
* *
* STRING *
* *
*********************/
/**
* @param {String} sStart
*
* @returns Whether or not this string starts with the string passed in.
* @type Boolean
*/
String.prototype.startsWith = function(sStart){
return (this.substr(0,sStart.length) == sStart);
};
/**
* @param {String} str
*
* @returns Whether or not this string contains with the string passed in.
* @type Boolean
*/
String.prototype.contains = function(str){
return (this.indexOf(str) != -1);
};
/**
* @returns A trimmed version of the string - all leading and
* trailing spaces removed
* @type String
*/
String.prototype.trim = function() {
var b = 0;
while(this.substr(b,1) == " ") {
b++;
}
var e = this.length - 1;
while(this.substr(e,1) == " ") {
e--;
}
return this.substring(b, e+1);
};
/*********************
* *
* ARRAY *
* *
*********************/
/** Remove an object from an array. Iterates through the array
* to find the item, then removes it.
*
* @param {Object} item
*
* @returns A reference to the array
* @type Array
*/
Array.prototype.remove = function(item) {
for(var i=0; i < this.length; i++) {
if(this[i] == item) {
this.splice(i,1);
//break;more than once??
}
}
return this;
}
/**
* @returns A fresh copy of the array
* @type Array
*/
Array.prototype.clone = function() {
var clone = new Array();
for (var i = 0; i < this.length; i++) {
clone[i] = this[i];
}
return clone;
};
/**
*/
Array.prototype.clear = function() {
this.length = 0;
};
/*********************
* *
* NUMBER *
* *
*********************/
/** NOTE: Works only with integer values does *not* work with floats!
*
* @param {int} sig
*
* @returns The number, rounded to the specified number of significant digits.
* If null, 0, or negaive value passed in, returns 0
* @type int
*/
Number.prototype.limitSigDigs = function(sig) {
var number = (sig > 0) ? this.toString() : 0;
if (sig < number.length) {
var exp = number.length - sig;
number = Math.round( this / Math.pow(10, exp)) * Math.pow(10, exp);
}
return parseInt(number);
}

View File

@@ -1,12 +1,16 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
* text of the license. */
/**
* @class
*/
OpenLayers.Control = Class.create();
OpenLayers.Control.prototype = {
/** @type String */
id: null,
/** this gets set in the addControl() function in OpenLayers.Map
* @type OpenLayers.Map */
map: null,
@@ -17,33 +21,59 @@ OpenLayers.Control.prototype = {
/** @type OpenLayers.Pixel */
position: null,
/** @type OpenLayers.Pixel */
mouseDragStart: null,
/**
* @constructor
*/
* @constructor
*
* @param {Object} options
*/
initialize: function (options) {
Object.extend(this, options);
this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");
},
/**
* @param {OpenLayers.Pixel} px
*
* @returns A reference to the DIV DOMElement containing the control
* @type DOMElement
*/
*
*/
destroy: function () {
// eliminate circular references
this.map = null;
},
/** Set the map property for the control. This is done through an accessor
* so that subclasses can override this and take special action once
* they have their map variable set.
*
* @param {OpenLayers.Map} map
*/
setMap: function(map) {
this.map = map;
},
/**
* @param {OpenLayers.Pixel} px
*
* @returns A reference to the DIV DOMElement containing the control
* @type DOMElement
*/
draw: function (px) {
if (this.div == null) {
this.div = OpenLayers.Util.createDiv();
this.div.id = this.id;
}
if (px != null) {
this.position = px.copyOf();
this.position = px.clone();
}
this.moveTo(this.position);
return this.div;
},
/**
* @param {OpenLayers.Pixel} px
*/
* @param {OpenLayers.Pixel} px
*/
moveTo: function (px) {
if ((px != null) && (this.div != null)) {
this.div.style.left = px.x + "px";
@@ -51,13 +81,6 @@ OpenLayers.Control.prototype = {
}
},
/**
*/
destroy: function () {
// eliminate circular references
this.map = null;
},
/** @final @type String */
CLASS_NAME: "OpenLayers.Control"
};

View File

@@ -1,10 +1,11 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
* text of the license. */
// @require: OpenLayers/Control.js
/**
* @class
*
* @requires OpenLayers/Control.js
*/
OpenLayers.Control.KeyboardDefaults = Class.create();
OpenLayers.Control.KeyboardDefaults.prototype =
@@ -33,31 +34,20 @@ OpenLayers.Control.KeyboardDefaults.prototype =
* @param {Event} evt
*/
defaultKeyDown: function (evt) {
var slide = this.map.getResolution() * this.slideFactor;
var center = this.map.getCenter();
var newCenter = center.copyOf();
switch(evt.keyCode) {
case Event.KEY_LEFT:
newCenter = newCenter.add( -slide, 0);
this.map.pan(-50, 0);
break;
case Event.KEY_RIGHT:
newCenter = newCenter.add( slide, 0);
this.map.pan(50, 0);
break;
case Event.KEY_UP:
newCenter = newCenter.add( 0, slide);
this.map.pan(0, -50);
break;
case Event.KEY_DOWN:
newCenter = newCenter.add( 0, -slide);
this.map.pan(0, 50);
break;
}
if (!newCenter.equals(center)) {
this.map.setCenter(newCenter);
Event.stop(evt);
}
},
/** @final @type String */

View File

@@ -1,221 +1,422 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
* text of the license. */
// @require: OpenLayers/Control.js
/**
* @class
*/
* @class
*
* @requires OpenLayers/Control.js
*/
OpenLayers.Control.LayerSwitcher = Class.create();
/** color used in the UI to show a layer is active/displayed
*
* @final
* @type String
*/
OpenLayers.Control.LayerSwitcher.ACTIVE_COLOR = "darkblue";
/** color used in the UI to show a layer is deactivated/hidden
*
* @final
* @type String
*/
OpenLayers.Control.LayerSwitcher.NONACTIVE_COLOR = "lightblue";
OpenLayers.Control.LayerSwitcher.prototype =
Object.extend( new OpenLayers.Control(), {
/** @type String */
activeColor: "",
activeColor: "darkblue",
/** @type String */
nonActiveColor: "",
/** @type String */
mode: "checkbox",
// DOM Elements
/** @type DOMElement */
layersDiv: null,
/** @type DOMElement */
baseLayersDiv: null,
/** @type Array */
baseLayerInputs: null,
/** @type DOMElement */
dataLbl: null,
/** @type DOMElement */
dataLayersDiv: null,
/** @type Array */
dataLayerInputs: null,
/** @type DOMElement */
minimizeDiv: null,
/** @type DOMElement */
maximizeDiv: null,
/**
* @constructor
*/
initialize: function(options) {
this.activeColor = OpenLayers.Control.LayerSwitcher.ACTIVE_COLOR;
this.nonActiveColor = OpenLayers.Control.LayerSwitcher.NONACTIVE_COLOR;
this.backdrops = [];
OpenLayers.Control.prototype.initialize.apply(this, arguments);
},
/**
* @param {OpenLayers.Map} map
*/
setMap: function(map) {
OpenLayers.Control.prototype.setMap.apply(this, arguments);
this.map.events.register("addlayer", this, this.redraw);
this.map.events.register("changelayer", this, this.redraw);
this.map.events.register("removelayer", this, this.redraw);
this.map.events.register("changebaselayer", this, this.redraw);
},
/**
* @returns A reference to the DIV DOMElement containing the switcher tabs
* @type DOMElement
*/
draw: function() {
// initialize our internal div
OpenLayers.Control.prototype.draw.apply(this);
// create layout divs
this.loadContents();
// set mode to minimize
this.minimizeControl();
// populate div with current info
this.redraw();
return this.div;
},
/** Goes through and takes the current state of the Map and rebuilds the
* control to display that state. Groups base layers into a radio-button
* group and lists each data layer with a checkbox.
*
* @returns A reference to the DIV DOMElement containing the control
* @type DOMElement
*/
redraw: function() {
//clear out previous layers
this.baseLayersDiv.innerHTML = "";
this.baseLayerInputs = new Array();
this.dataLayersDiv.innerHTML = "";
this.dataLayerInputs = new Array();
var containsOverlays = false;
for( var i = 0; i < this.map.layers.length; i++) {
var layer = this.map.layers[i];
var baseLayer = layer.isBaseLayer;
if (!baseLayer) {
containsOverlays = true;
}
// only check a baselayer if it is *the* baselayer, check data
// layers if they are visible
var checked = (baseLayer) ? (layer == this.map.baseLayer)
: layer.getVisibility();
// create input element
var inputElem = document.createElement("input");
inputElem.id = "input_" + layer.name;
inputElem.name = (baseLayer) ? "baseLayers" : layer.name;
inputElem.type = (baseLayer) ? "radio" : "checkbox";
inputElem.value = layer.name;
inputElem.checked = checked;
inputElem.defaultChecked = checked;
inputElem.layer = layer;
inputElem.control = this;
Event.observe(inputElem, "mouseup",
this.onInputClick.bindAsEventListener(inputElem));
// create span
var labelSpan = document.createElement("span");
labelSpan.innerHTML = layer.name;
labelSpan.style.verticalAlign = (baseLayer) ? "bottom" : "baseline";
Event.observe(labelSpan, "click",
this.onInputClick.bindAsEventListener(inputElem));
// create line break
var br = document.createElement("br");
var groupArray = (baseLayer) ? this.baseLayerInputs
: this.dataLayerInputs;
groupArray.push(inputElem);
var groupDiv = (baseLayer) ? this.baseLayersDiv
: this.dataLayersDiv;
groupDiv.appendChild(inputElem);
groupDiv.appendChild(labelSpan);
groupDiv.appendChild(br);
}
// if no overlays, dont display the overlay label
this.dataLbl.style.display = (containsOverlays) ? "" : "none";
return this.div;
},
/** A label has been clicked, check or uncheck its corresponding input
*
* @private
*
* @param {Event} e
*/
onInputClick: function(e) {
if (this.type == "radio") {
this.checked = true;
this.layer.map.setBaseLayer(this.layer, true);
this.layer.map.events.triggerEvent("changebaselayer");
} else {
this.checked = !this.checked;
this.control.updateMap();
}
Event.stop(e);
},
/** Need to update the map accordingly whenever user clicks in either of
* the layers.
*
* @private
*
* @param {Event} e
*/
onLayerClick: function(e) {
this.updateMap();
},
/** Cycles through the loaded data and base layer input arrays and makes
* the necessary calls to the Map object such that that the map's
* visual state corresponds to what the user has selected in the control
*
* @private
*/
updateMap: function() {
// set the newly selected base layer
for(var i=0; i < this.baseLayerInputs.length; i++) {
var input = this.baseLayerInputs[i];
if (input.checked) {
this.map.setBaseLayer(input.layer, false);
}
}
// set the correct visibilities for the overlays
for(var i=0; i < this.dataLayerInputs.length; i++) {
var input = this.dataLayerInputs[i];
input.layer.setVisibility(input.checked, true);
}
},
/** Set up the labels and divs for the control
*
* @param {Event} e
*/
maximizeControl: function(e) {
//HACK HACK HACK - find a way to auto-size this layerswitcher
this.div.style.width = "20em";
this.div.style.height = "";
this.showControls(false);
if (e != null) {
Event.stop(e);
}
},
/** Hide all the contents of the control, shrink the size,
* add the maximize icon
*
* @param {Event} e
*/
minimizeControl: function(e) {
this.div.style.width = "0px";
this.div.style.height = "0px";
this.showControls(true);
if (e != null) {
Event.stop(e);
}
},
/** Hide/Show all LayerSwitcher controls depending on whether we are
* minimized or not
*
* @private
*
* @param {Boolean} minimize
*/
showControls: function(minimize) {
this.maximizeDiv.style.display = minimize ? "" : "none";
this.minimizeDiv.style.display = minimize ? "none" : "";
this.layersDiv.style.display = minimize ? "none" : "";
},
/** Set up the labels and divs for the control
*
*/
loadContents: function() {
//configure main div
this.div.style.position = "absolute";
this.div.style.top = "10px";
this.div.style.right = "0px";
this.div.style.left = "";
this.div.style.fontFamily = "sans-serif";
this.div.style.color = "white";
this.div.style.fontWeight = "bold";
this.div.style.marginTop = "3px";
this.div.style.marginLeft = "3px";
this.div.style.marginBottom = "3px";
this.div.style.fontSize="smaller";
this.div.style.width = "10em";
this.map.events.register("addlayer", this, this.redraw);
this.map.events.register("removelayer", this, this.redraw);
return this.redraw();
},
/**
* @returns A reference to the DIV DOMElement containing the switcher tabs
* @type DOMElement
*/
redraw: function() {
//clear out previous incarnation of LayerSwitcher tabs
this.div.innerHTML = "";
var visible = false;
for( var i = 0; i < this.map.layers.length; i++) {
if (visible && this.mode == "radio") {
this.map.layers[i].setVisibility(false);
} else {
visible = this.map.layers[i].getVisibility();
}
this.addTab(this.map.layers[i]);
}
return this.div;
},
this.div.style.fontSize = "smaller";
this.div.style.color = "white";
this.div.style.backgroundColor = "transparent";
/**
* @param {event} evt
*/
singleClick: function(evt) {
var div = Event.element(evt);
Event.observe(this.div, "mouseup",
this.mouseUp.bindAsEventListener(this));
Event.observe(this.div, "click",
this.ignoreEvent);
Event.observe(this.div, "mousedown",
this.mouseDown.bindAsEventListener(this));
Event.observe(this.div, "dblclick", this.ignoreEvent);
// See comment about OL #57 fix below.
// If the click occurred on the corner spans we need
// to make sure we act on the actual label tab instead.
div = div.labelElement || div;
var layer = div.layer;
if (this.mode == "radio") {
for(var i=0; i < this.backdrops.length; i++) {
this.setTabActivation(this.backdrops[i], false);
this.backdrops[i].layer.setVisibility(false);
}
this.setTabActivation(div, true);
layer.setVisibility(true);
} else {
var visible = layer.getVisibility();
this.setTabActivation(div, !visible);
layer.setVisibility(!visible);
}
Event.stop(evt);
},
/**
* @private
*
* @param {event} evt
*/
ignoreEvent: function(evt) {
Event.stop(evt);
return false;
},
// layers list div
this.layersDiv = document.createElement("div");
this.layersDiv.id = "layersDiv";
this.layersDiv.style.paddingTop = "5px";
this.layersDiv.style.paddingLeft = "10px";
this.layersDiv.style.paddingBottom = "5px";
this.layersDiv.style.paddingRight = "75px";
this.layersDiv.style.backgroundColor = this.activeColor;
/**
* @private
*
* @param {OpenLayers.Layer} layer
*/
addTab: function(layer) {
// Outer DIV - for Rico Corners
// had to set width/height to get transparency in IE to work.
// thanks -- http://jszen.blogspot.com/2005/04/ie6-opacity-filter-caveat.html
//
var backdropLabelOuter = document.createElement('div');
backdropLabelOuter.id = "LayerSwitcher_" + layer.name + "_Tab";
backdropLabelOuter.style.marginTop = "4px";
backdropLabelOuter.style.marginBottom = "4px";
// Inner Label - for Rico Corners
//
var backdropLabel = document.createElement('p');
backdropLabel.innerHTML = layer.name;
backdropLabel.style.marginTop = "0px";
backdropLabel.style.marginBottom = "0px";
backdropLabel.style.paddingLeft = "10px";
backdropLabel.style.paddingRight = "10px";
// add reference to layer onto the div for use in event handlers
backdropLabel.layer = layer;
this.layersDiv.style.width = "100%";
this.layersDiv.style.height = "100%";
// set event handlers
this._setEventHandlers(backdropLabel);
// add label to div
backdropLabelOuter.appendChild(backdropLabel);
var baseLbl = document.createElement("div");
baseLbl.innerHTML = "<u>Base Layer</u>";
baseLbl.style.marginTop = "3px";
baseLbl.style.marginLeft = "3px";
baseLbl.style.marginBottom = "3px";
this.layersDiv.appendChild(baseLbl);
this.backdrops.append(backdropLabel);
// add div to main LayerSwitcher Div
this.div.appendChild(backdropLabelOuter);
this.baseLayersDiv = document.createElement("div");
this.baseLayersDiv.style.paddingLeft = "10px";
/*Event.observe(this.baseLayersDiv, "click",
this.onLayerClick.bindAsEventListener(this));
*/
this.layersDiv.appendChild(this.baseLayersDiv);
Rico.Corner.round(backdropLabelOuter, {corners: "tl bl",
this.dataLbl = document.createElement("div");
this.dataLbl.innerHTML = "<u>Overlays</u>";
this.dataLbl.style.marginTop = "3px";
this.dataLbl.style.marginLeft = "3px";
this.dataLbl.style.marginBottom = "3px";
this.layersDiv.appendChild(this.dataLbl);
this.dataLayersDiv = document.createElement("div");
this.dataLayersDiv.style.paddingLeft = "10px";
/*Event.observe(this.dataLayersDiv, "click",
this.onLayerClick.bindAsEventListener(this));
*/
this.layersDiv.appendChild(this.dataLayersDiv);
this.div.appendChild(this.layersDiv);
Rico.Corner.round(this.div, {corners: "tl bl",
bgColor: "transparent",
color: "white",
color: this.activeColor,
blend: false});
// extend the event handlers to operate on the
// rounded corners as well. (Fixes OL #57.)
var spanElements=backdropLabel.parentNode.getElementsByTagName("span");
Rico.Corner.changeOpacity(this.layersDiv, 0.75);
var imgLocation = OpenLayers.Util.getImagesLocation();
var sz = new OpenLayers.Size(18,18);
// maximize button div
var img = imgLocation + 'layer-switcher-maximize.png';
this.maximizeDiv = OpenLayers.Util.createAlphaImageDiv(
"OpenLayers_Control_MaximizeDiv",
null,
sz,
img,
"absolute");
this.maximizeDiv.style.top = "5px";
this.maximizeDiv.style.right = "0px";
this.maximizeDiv.style.left = "";
this.maximizeDiv.style.display = "none";
Event.observe(this.maximizeDiv,
"click",
this.maximizeControl.bindAsEventListener(this));
for (var currIdx = 0; currIdx < spanElements.length; currIdx++) {
this._setEventHandlers(spanElements[currIdx], backdropLabel);
}
this.div.appendChild(this.maximizeDiv);
this.setTabActivation(backdropLabel, layer.getVisibility());
// minimize button div
var img = imgLocation + 'layer-switcher-minimize.png';
var sz = new OpenLayers.Size(18,18);
this.minimizeDiv = OpenLayers.Util.createAlphaImageDiv(
"OpenLayers_Control_MinimizeDiv",
null,
sz,
img,
"absolute");
this.minimizeDiv.style.top = "5px";
this.minimizeDiv.style.right = "0px";
this.minimizeDiv.style.left = "";
this.minimizeDiv.style.display = "none";
Event.observe(this.minimizeDiv,
"click",
this.minimizeControl.bindAsEventListener(this));
this.div.appendChild(this.minimizeDiv);
},
/*
@private
@param {DOMElement} div
@param {Boolean} activate
*/
_setEventHandlers : function(element, labelDiv) {
/**
* @private
*
* @param {Event} evt
*/
ignoreEvent: function(evt) {
Event.stop(evt);
},
// We only want to respond to a mousedown event.
element.onclick = this.ignoreEvent.bindAsEventListener(this);
element.ondblclick = this.ignoreEvent.bindAsEventListener(this);
element.onmousedown = this.singleClick.bindAsEventListener(this);
/** Register a local 'mouseDown' flag so that we'll know whether or not
* to ignore a mouseUp event
*
* @private
*
* @param {Event} evt
*/
mouseDown: function(evt) {
this.mouseDown = true;
this.ignoreEvent(evt);
},
// If we are operating on a corner span we need to store a
// reference to the actual tab. (See comment about OL #57 fix above.)
if (labelDiv) {
element.labelElement = labelDiv;
/** If the 'mouseDown' flag has been set, that means that the drag was
* started from within the LayerSwitcher control, and thus we can
* ignore the mouseup. Otherwise, let the Event continue.
*
* @private
*
* @param {Event} evt
*/
mouseUp: function(evt) {
if (this.mouseDown) {
this.mouseDown = false;
this.ignoreEvent(evt);
}
},
/**
* @private
*
* @param {DOMElement} div
* @param {Boolean} activate
*/
setTabActivation:function(div, activate) {
var color = (activate) ? this.activeColor : this.nonActiveColor;
Rico.Corner.changeColor(div, color);
},
/** @final @type String */
CLASS_NAME: "OpenLayers.Control.LayerSwitcher"
});

View File

@@ -0,0 +1,226 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
* text of the license. */
/**
* @class
*
* @requires OpenLayers/Control.js
*/
OpenLayers.Control.LayerTabs = Class.create();
/** color used in the UI to show a layer is active/displayed
*
* @final
* @type String
*/
OpenLayers.Control.LayerTabs.ACTIVE_COLOR = "darkblue";
/** color used in the UI to show a layer is deactivated/hidden
*
* @final
* @type String
*/
OpenLayers.Control.LayerTabs.NONACTIVE_COLOR = "lightblue";
OpenLayers.Control.LayerTabs.prototype =
Object.extend( new OpenLayers.Control(), {
/** @type String */
activeColor: "",
/** @type String */
nonActiveColor: "",
/** @type String */
mode: "checkbox",
/**
* @constructor
*/
initialize: function(options) {
this.activeColor = OpenLayers.Control.LayerTabs.ACTIVE_COLOR;
this.nonActiveColor = OpenLayers.Control.LayerTabs.NONACTIVE_COLOR;
this.backdrops = [];
OpenLayers.Control.prototype.initialize.apply(this, arguments);
},
/**
* @returns A reference to the DIV DOMElement containing the switcher tabs
* @type DOMElement
*/
draw: function() {
// initialize our internal div
OpenLayers.Control.prototype.draw.apply(this);
this.div.style.position = "absolute";
this.div.style.top = "10px";
this.div.style.right = "0px";
this.div.style.left = "";
this.div.style.fontFamily = "sans-serif";
this.div.style.color = "white";
this.div.style.fontWeight = "bold";
this.div.style.marginTop = "3px";
this.div.style.marginLeft = "3px";
this.div.style.marginBottom = "3px";
this.div.style.fontSize="smaller";
this.div.style.width = "10em";
this.map.events.register("addlayer", this, this.redraw);
this.map.events.register("removelayer", this, this.redraw);
return this.redraw();
},
/**
* @returns A reference to the DIV DOMElement containing the switcher tabs
* @type DOMElement
*/
redraw: function() {
//clear out previous incarnation of LayerTabs tabs
this.div.innerHTML = "";
var visible = false;
for( var i = 0; i < this.map.layers.length; i++) {
if (visible && this.mode == "radio") {
this.map.layers[i].setVisibility(false);
} else {
visible = this.map.layers[i].getVisibility();
}
this.addTab(this.map.layers[i]);
}
return this.div;
},
/**
* @param {Event} evt
*/
singleClick: function(evt) {
var div = Event.element(evt);
// See comment about OL #57 fix below.
// If the click occurred on the corner spans we need
// to make sure we act on the actual label tab instead.
div = div.labelElement || div;
var layer = div.layer;
if (this.mode == "radio") {
for(var i=0; i < this.backdrops.length; i++) {
this.setTabActivation(this.backdrops[i], false);
this.backdrops[i].layer.setVisibility(false);
}
this.setTabActivation(div, true);
layer.setVisibility(true);
} else {
var visible = layer.getVisibility();
this.setTabActivation(div, !visible);
layer.setVisibility(!visible);
}
Event.stop(evt);
},
/**
* @private
*
* @param {Event} evt
*/
ignoreEvent: function(evt) {
Event.stop(evt);
return false;
},
/**
* @private
*
* @param {OpenLayers.Layer} layer
*/
addTab: function(layer) {
// Outer DIV - for Rico Corners
//
var backdropLabelOuter = document.createElement('div');
backdropLabelOuter.id = "LayerTabs_" + layer.name + "_Tab";
backdropLabelOuter.style.marginTop = "4px";
backdropLabelOuter.style.marginBottom = "4px";
this._setEventHandlers(backdropLabelOuter);
// Inner Label - for Rico Corners
//
var backdropLabel = document.createElement('p');
backdropLabel.innerHTML = layer.name;
backdropLabel.style.marginTop = "0px";
backdropLabel.style.marginBottom = "0px";
backdropLabel.style.paddingLeft = "10px";
backdropLabel.style.paddingRight = "10px";
// add reference to layer onto the div for use in event handlers
backdropLabel.layer = layer;
// set event handlers
this._setEventHandlers(backdropLabel);
// add label to div
backdropLabelOuter.appendChild(backdropLabel);
this.backdrops.push(backdropLabel);
// add div to main LayerTabs Div
this.div.appendChild(backdropLabelOuter);
Rico.Corner.round(backdropLabelOuter, {corners: "tl bl",
bgColor: "transparent",
color: "white",
blend: false});
// extend the event handlers to operate on the
// rounded corners as well. (Fixes OL #57.)
var spanElements=backdropLabel.parentNode.getElementsByTagName("span");
for (var currIdx = 0; currIdx < spanElements.length; currIdx++) {
this._setEventHandlers(spanElements[currIdx], backdropLabel);
}
this.setTabActivation(backdropLabel, layer.getVisibility());
},
/*
@private
@param {DOMElement} div
@param {Boolean} activate
*/
_setEventHandlers : function(element, labelDiv) {
// We only want to respond to a mousedown event.
element.onclick = this.singleClick.bindAsEventListener(this);
element.ondblclick = this.singleClick.bindAsEventListener(this);
element.onmouseup = this.ignoreEvent.bindAsEventListener(this);
element.onmousedown = this.ignoreEvent.bindAsEventListener(this);
// If we are operating on a corner span we need to store a
// reference to the actual tab. (See comment about OL #57 fix above.)
if (labelDiv) {
element.labelElement = labelDiv;
}
},
/**
* @private
*
* @param {DOMElement} div
* @param {Boolean} activate
*/
setTabActivation:function(div, activate) {
var color = (activate) ? this.activeColor : this.nonActiveColor;
Rico.Corner.changeColor(div, color);
},
/** @final @type String */
CLASS_NAME: "OpenLayers.Control.LayerTabs"
});

View File

@@ -1,17 +1,37 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
* text of the license. */
// @require: OpenLayers/Control.js
/**
* @class
*
* @requires OpenLayers/Control.js
*/
OpenLayers.Control.MouseDefaults = Class.create();
OpenLayers.Control.MouseDefaults.prototype =
Object.extend( new OpenLayers.Control(), {
/** @type Boolean */
performedDrag: false,
/**
* @constructor
*/
initialize: function() {
OpenLayers.Control.prototype.initialize.apply(this, arguments);
//register mousewheel events specifically on the window and document
Event.observe(window, "DOMMouseScroll",
this.onWheelEvent.bindAsEventListener(this));
Event.observe(window, "mousewheel",
this.onWheelEvent.bindAsEventListener(this));
Event.observe(document, "mousewheel",
this.onWheelEvent.bindAsEventListener(this));
},
/**
*
*/
draw: function() {
this.map.events.register( "click", this, this.defaultClick );
this.map.events.register( "dblclick", this, this.defaultDblClick );
@@ -21,7 +41,13 @@ OpenLayers.Control.MouseDefaults.prototype =
this.map.events.register( "mouseout", this, this.defaultMouseOut );
},
/**
* @param {Event} evt
*
* @type Boolean
*/
defaultClick: function (evt) {
if (!Event.isLeftClick(evt)) return;
var notAfterDrag = !this.performedDrag;
this.performedDrag = false;
return notAfterDrag;
@@ -33,13 +59,16 @@ OpenLayers.Control.MouseDefaults.prototype =
defaultDblClick: function (evt) {
var newCenter = this.map.getLonLatFromViewPortPx( evt.xy );
this.map.setCenter(newCenter, this.map.zoom + 1);
Event.stop(evt);
return false;
},
/**
* @param {Event} evt
*/
defaultMouseDown: function (evt) {
this.mouseDragStart = evt.xy.copyOf();
if (!Event.isLeftClick(evt)) return;
this.mouseDragStart = evt.xy.clone();
this.performedDrag = false;
if (evt.shiftKey) {
this.map.div.style.cursor = "crosshair";
@@ -52,6 +81,7 @@ OpenLayers.Control.MouseDefaults.prototype =
this.zoomBox.style.backgroundColor = "white";
this.zoomBox.style.filter = "alpha(opacity=50)"; // IE
this.zoomBox.style.opacity = "0.50";
this.zoomBox.style.fontSize = "1px";
this.zoomBox.style.zIndex = this.map.Z_INDEX_BASE["Popup"] - 1;
this.map.viewPortDiv.appendChild(this.zoomBox);
}
@@ -67,8 +97,8 @@ OpenLayers.Control.MouseDefaults.prototype =
if (this.zoomBox) {
var deltaX = Math.abs(this.mouseDragStart.x - evt.xy.x);
var deltaY = Math.abs(this.mouseDragStart.y - evt.xy.y);
this.zoomBox.style.width = deltaX+"px";
this.zoomBox.style.height = deltaY+"px";
this.zoomBox.style.width = Math.max(1, deltaX) + "px";
this.zoomBox.style.height = Math.max(1, deltaY) + "px";
if (evt.xy.x < this.mouseDragStart.x) {
this.zoomBox.style.left = evt.xy.x+"px";
}
@@ -83,7 +113,7 @@ OpenLayers.Control.MouseDefaults.prototype =
size.h / 2 + deltaY);
var newCenter = this.map.getLonLatFromViewPortPx( newXY );
this.map.setCenter(newCenter, null, true);
this.mouseDragStart = evt.xy.copyOf();
this.mouseDragStart = evt.xy.clone();
this.map.div.style.cursor = "move";
}
this.performedDrag = true;
@@ -94,34 +124,127 @@ OpenLayers.Control.MouseDefaults.prototype =
* @param {Event} evt
*/
defaultMouseUp: function (evt) {
if (!Event.isLeftClick(evt)) return;
if (this.zoomBox) {
var start = this.map.getLonLatFromViewPortPx( this.mouseDragStart );
var end = this.map.getLonLatFromViewPortPx( evt.xy );
var top = Math.max(start.lat, end.lat);
var bottom = Math.min(start.lat, end.lat);
var left = Math.min(start.lon, end.lon);
var right = Math.max(start.lon, end.lon);
var bounds = new OpenLayers.Bounds(left, bottom, right, top);
var zoom = this.map.getZoomForExtent(bounds);
this.map.setCenter(new OpenLayers.LonLat(
(start.lon + end.lon) / 2,
(start.lat + end.lat) / 2
), zoom);
this.map.viewPortDiv.removeChild(document.getElementById("zoomBox"));
this.zoomBox = null;
this.zoomBoxEnd(evt);
} else {
this.map.setCenter(this.map.center);
if (this.performedDrag) {
this.map.setCenter(this.map.center);
}
}
document.onselectstart=null;
this.mouseDragStart = null;
this.map.div.style.cursor = "default";
},
/**
* @param {Event} evt
*/
defaultMouseOut: function (evt) {
if (this.mouseDragStart != null
&& OpenLayers.Util.mouseLeft(evt, this.map.div)) {
this.defaultMouseUp(evt);
}
}
},
/** User spun scroll wheel up
*
*/
defaultWheelUp: function() {
this.map.zoomIn();
},
/** User spun scroll wheel down
*
*/
defaultWheelDown: function() {
this.map.zoomOut();
},
/** Zoombox function.
*
*/
zoomBoxEnd: function(evt) {
if (this.mouseDragStart != null) {
if (Math.abs(this.mouseDragStart.x - evt.xy.x) > 5 ||
Math.abs(this.mouseDragStart.y - evt.xy.y) > 5) {
var start = this.map.getLonLatFromViewPortPx( this.mouseDragStart );
var end = this.map.getLonLatFromViewPortPx( evt.xy );
var top = Math.max(start.lat, end.lat);
var bottom = Math.min(start.lat, end.lat);
var left = Math.min(start.lon, end.lon);
var right = Math.max(start.lon, end.lon);
var bounds = new OpenLayers.Bounds(left, bottom, right, top);
var zoom = this.map.getZoomForExtent(bounds);
this.map.setCenter(new OpenLayers.LonLat(
(start.lon + end.lon) / 2,
(start.lat + end.lat) / 2
), zoom);
} else {
var end = this.map.getLonLatFromViewPortPx( evt.xy );
this.map.setCenter(new OpenLayers.LonLat(
(end.lon),
(end.lat)
), this.map.getZoom() + 1);
}
this.map.viewPortDiv.removeChild(this.zoomBox);
this.zoomBox = null;
}
},
/**
* Mouse ScrollWheel code thanks to http://adomas.org/javascript-mouse-wheel/
*/
/** Catch the wheel event and handle it xbrowserly
*
* @param {Event} e
*/
onWheelEvent: function(e){
// first determine whether or not the wheeling was inside the map
var inMap = false;
var elem = Event.element(e);
while(elem != null) {
if (this.map && elem == this.map.div) {
inMap = true;
break;
}
elem = elem.parentNode;
}
if (inMap) {
var delta = 0;
if (!e) {
e = window.event;
}
if (e.wheelDelta) {
delta = e.wheelDelta/120;
if (window.opera) {
delta = -delta;
}
} else if (e.detail) {
delta = -e.detail / 3;
}
if (delta) {
if (delta < 0) {
this.defaultWheelDown();
} else {
this.defaultWheelUp();
}
}
//only wheel the map, not the window
Event.stop(e);
}
},
/** @final @type String */
CLASS_NAME: "OpenLayers.Control.MouseDefaults"
});

View File

@@ -1,12 +1,19 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
* text of the license. */
// @require: OpenLayers/Control.js
/**
* @class
*
* @requires OpenLayers/Control.js
* @requires OpenLayers/Control/MouseDefaults.js
*/
OpenLayers.Control.MouseToolbar = Class.create();
OpenLayers.Control.MouseToolbar.X = 6;
OpenLayers.Control.MouseToolbar.Y = 300;
OpenLayers.Control.MouseToolbar.prototype =
Object.extend( new OpenLayers.Control(), {
Object.extend( new OpenLayers.Control(),
Object.extend( new OpenLayers.Control.MouseDefaults(), {
mode: null,
@@ -28,22 +35,16 @@ OpenLayers.Control.MouseToolbar.prototype =
},
draw: function() {
OpenLayers.Control.prototype.draw.apply(this, arguments);
OpenLayers.Control.prototype.draw.apply(this, arguments);
OpenLayers.Control.MouseDefaults.prototype.draw.apply(this, arguments);
this.buttons = new Object();
this.map.events.register( "dblclick", this, this.defaultDblClick );
this.map.events.register( "mousedown", this, this.defaultMouseDown );
this.map.events.register( "mouseup", this, this.defaultMouseUp );
this.map.events.register( "mousemove", this, this.defaultMouseMove );
this.map.events.register( "mouseout", this, this.defaultMouseOut );
var sz = new OpenLayers.Size(28,28);
var centered = this.position;
this._addButton("zoombox", "drag-rectangle-off.png", "drag-rectangle-on.png", centered, sz, "Shift->Drag to zoom to area");
centered = centered.add((this.direction == "vertical" ? 0 : sz.w), (this.direction == "vertical" ? sz.h : 0));
this._addButton("pan", "panning-hand-off.png", "panning-hand-on.png", centered, sz, "Drag the map to pan.");
centered = centered.add((this.direction == "vertical" ? 0 : sz.w), (this.direction == "vertical" ? sz.h : 0));
this._addButton("measure", "measuring-stick-off.png", "measuring-stick-on.png", centered, sz, "Hold alt when clicking to show distance between selected points");
this.switchModeTo("pan");
this.map.events.register("zoomend", this, function() { this.switchModeTo("pan"); });
return this.div;
},
@@ -63,7 +64,8 @@ OpenLayers.Control.MouseToolbar.prototype =
btn.events = new OpenLayers.Events(this, btn);
btn.events.register("mousedown", this, this.buttonClick);
btn.events.register("mouseup", this, this.stopAction);
btn.events.register("mouseup", this, Event.stop);
btn.events.register("click", this, Event.stop);
btn.action = id;
btn.title = title;
btn.alt = title;
@@ -74,12 +76,9 @@ OpenLayers.Control.MouseToolbar.prototype =
return btn;
},
stopAction: function(evt) {
Event.stop(evt);
},
buttonClick: function(evt) {
this.switchModeTo(evt.div.action);
if (!Event.isLeftClick(evt)) return;
this.switchModeTo(evt.element.action);
Event.stop(evt);
},
@@ -88,17 +87,24 @@ OpenLayers.Control.MouseToolbar.prototype =
*/
defaultDblClick: function (evt) {
this.switchModeTo("pan");
this.performedDrag = false;
var newCenter = this.map.getLonLatFromViewPortPx( evt.xy );
this.map.setCenter(newCenter, this.map.zoom + 2);
Event.stop(evt);
return false;
},
/**
* @param {Event} evt
*/
defaultMouseDown: function (evt) {
this.mouseDragStart = evt.xy.copyOf();
if (!Event.isLeftClick(evt)) return;
this.mouseDragStart = evt.xy.clone();
this.performedDrag = false;
this.startViaKeyboard = false;
if (evt.shiftKey && this.mode !="zoombox") {
this.switchModeTo("zoombox");
this.startViaKeyboard = true;
} else if (evt.altKey && this.mode !="measure") {
this.switchModeTo("measure");
} else if (!this.mode) {
@@ -117,8 +123,10 @@ OpenLayers.Control.MouseToolbar.prototype =
this.zoomBox.style.backgroundColor = "white";
this.zoomBox.style.filter = "alpha(opacity=50)"; // IE
this.zoomBox.style.opacity = "0.50";
this.zoomBox.style.fontSize = "1px";
this.zoomBox.style.zIndex = this.map.Z_INDEX_BASE["Popup"] - 1;
this.map.viewPortDiv.appendChild(this.zoomBox);
this.performedDrag = true;
break;
case "measure":
var distance = "";
@@ -139,6 +147,7 @@ OpenLayers.Control.MouseToolbar.prototype =
"absolute");
this.measureBox.style.width="4px";
this.measureBox.style.height="4px";
this.measureBox.style.fontSize = "1px";
this.measureBox.style.backgroundColor="red";
this.measureBox.style.zIndex = this.map.Z_INDEX_BASE["Popup"] - 1;
this.map.layerContainerDiv.appendChild(this.measureBox);
@@ -154,11 +163,11 @@ OpenLayers.Control.MouseToolbar.prototype =
this.measureBoxDistance.innerHTML = distance;
this.measureBoxDistance.style.zIndex = this.map.Z_INDEX_BASE["Popup"] - 1;
this.map.layerContainerDiv.appendChild(this.measureBoxDistance);
this.measureDivs.append(this.measureBoxDistance);
this.measureDivs.push(this.measureBoxDistance);
}
this.measureBox.style.zIndex = this.map.Z_INDEX_BASE["Popup"] - 1;
this.map.layerContainerDiv.appendChild(this.measureBox);
this.measureDivs.append(this.measureBox);
this.measureDivs.push(this.measureBox);
break;
default:
this.map.div.style.cursor = "move";
@@ -170,8 +179,8 @@ OpenLayers.Control.MouseToolbar.prototype =
switchModeTo: function(mode) {
if (mode != this.mode) {
if (this.mode) {
this.buttons[this.mode].firstChild.src = this.buttons[this.mode].imgLocation;
if (this.mode && this.buttons[this.mode]) {
OpenLayers.Util.modifyAlphaImageDiv(this.buttons[this.mode], null, null, null, this.buttons[this.mode].imgLocation);
}
if (this.mode == "measure" && mode != "measure") {
for(var i = 0; i < this.measureDivs.length; i++) {
@@ -183,7 +192,9 @@ OpenLayers.Control.MouseToolbar.prototype =
this.measureStart = null;
}
this.mode = mode;
this.buttons[mode].firstChild.src = this.buttons[mode].activeImgLocation;
if (this.buttons[mode]) {
OpenLayers.Util.modifyAlphaImageDiv(this.buttons[mode], null, null, null, this.buttons[mode].activeImgLocation);
}
}
},
@@ -200,8 +211,8 @@ OpenLayers.Control.MouseToolbar.prototype =
case "zoombox":
var deltaX = Math.abs(this.mouseDragStart.x - evt.xy.x);
var deltaY = Math.abs(this.mouseDragStart.y - evt.xy.y);
this.zoomBox.style.width = deltaX+"px";
this.zoomBox.style.height = deltaY+"px";
this.zoomBox.style.width = Math.max(1, deltaX) + "px";
this.zoomBox.style.height = Math.max(1, deltaY) + "px";
if (evt.xy.x < this.mouseDragStart.x) {
this.zoomBox.style.left = evt.xy.x+"px";
}
@@ -217,8 +228,9 @@ OpenLayers.Control.MouseToolbar.prototype =
size.h / 2 + deltaY);
var newCenter = this.map.getLonLatFromViewPortPx( newXY );
this.map.setCenter(newCenter, null, true);
this.mouseDragStart = evt.xy.copyOf();
this.mouseDragStart = evt.xy.clone();
}
this.performedDrag = true;
}
},
@@ -226,27 +238,16 @@ OpenLayers.Control.MouseToolbar.prototype =
* @param {Event} evt
*/
defaultMouseUp: function (evt) {
if (!Event.isLeftClick(evt)) return;
switch (this.mode) {
case "zoombox":
var start = this.map.getLonLatFromViewPortPx( this.mouseDragStart );
var end = this.map.getLonLatFromViewPortPx( evt.xy );
var top = Math.max(start.lat, end.lat);
var bottom = Math.min(start.lat, end.lat);
var left = Math.min(start.lon, end.lon);
var right = Math.max(start.lon, end.lon);
var bounds = new OpenLayers.Bounds(left, bottom, right, top);
var zoom = this.map.getZoomForExtent(bounds);
this.map.setCenter(new OpenLayers.LonLat(
(start.lon + end.lon) / 2,
(start.lat + end.lat) / 2
), zoom);
this.map.viewPortDiv.removeChild(document.getElementById("zoomBox"));
this.zoomBox = null;
this.leaveMode();
this.zoomBoxEnd(evt);
if (this.startViaKeyboard) this.leaveMode();
break;
case "pan":
this.map.setCenter(this.map.center);
if (this.performedDrag) {
this.map.setCenter(this.map.center);
}
}
document.onselectstart = null;
this.mouseDragStart = null;
@@ -258,6 +259,12 @@ OpenLayers.Control.MouseToolbar.prototype =
&& OpenLayers.Util.mouseLeft(evt, this.map.div)) {
this.defaultMouseUp(evt);
}
},
defaultClick: function (evt) {
if (this.performedDrag) {
this.performedDrag = false;
return false;
}
}
});
}));

View File

@@ -1,12 +1,11 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
* text of the license. */
// @require: OpenLayers/Control.js
/**
* @class
*
* default zoom/pan controls
* @requires OpenLayers/Control.js
*/
OpenLayers.Control.PanZoom = Class.create();
OpenLayers.Control.PanZoom.X = 4;
@@ -77,7 +76,6 @@ OpenLayers.Control.PanZoom.prototype =
*/
_addButton:function(id, img, xy, sz) {
var imgLocation = OpenLayers.Util.getImagesLocation() + img;
// var btn = new ol.AlphaImage("_"+id, imgLocation, xy, sz);
var btn = OpenLayers.Util.createAlphaImageDiv(
"OpenLayers_Control_PanZoom_" + id,
xy, sz, imgLocation, "absolute");
@@ -98,7 +96,7 @@ OpenLayers.Control.PanZoom.prototype =
},
/**
* @param {event} evt
* @param {Event} evt
*
* @type Boolean
*/
@@ -108,27 +106,23 @@ OpenLayers.Control.PanZoom.prototype =
},
/**
* @param {event} evt
* @param {Event} evt
*/
buttonDown: function (evt) {
var slide = this.map.getResolution() * this.slideFactor;
var center = this.map.getCenter();
var newCenter = center.copyOf();
if (!Event.isLeftClick(evt)) return;
switch (this.action) {
case "panup":
newCenter = newCenter.add( 0, slide);
this.map.pan(0, -50);
break;
case "pandown":
newCenter = newCenter.add( 0, -slide);
this.map.pan(0, 50);
break;
case "panleft":
newCenter = newCenter.add( -slide, 0);
this.map.pan(-50, 0);
break;
case "panright":
newCenter = newCenter.add( slide, 0);
this.map.pan(50, 0);
break;
case "zoomin":
this.map.zoomIn();
@@ -137,14 +131,10 @@ OpenLayers.Control.PanZoom.prototype =
this.map.zoomOut();
break;
case "zoomworld":
this.map.zoomToFullExtent();
this.map.zoomToMaxExtent();
break;
}
if (!newCenter.equals(center)) {
this.map.setCenter(newCenter);
}
Event.stop(evt);
},

View File

@@ -1,16 +1,18 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
* text of the license. */
// @require: OpenLayers/Control/PanZoom.js
//
// default zoom/pan controls
//
/**
* @class
*
* @requires OpenLayers/Control/PanZoom.js
*/
OpenLayers.Control.PanZoomBar = Class.create();
OpenLayers.Control.PanZoomBar.X = 4;
OpenLayers.Control.PanZoomBar.Y = 4;
OpenLayers.Control.PanZoomBar.prototype =
Object.extend( new OpenLayers.Control.PanZoom(), {
/** @type Array(...) */
buttons: null,
@@ -26,13 +28,31 @@ OpenLayers.Control.PanZoomBar.prototype =
OpenLayers.Control.PanZoomBar.Y);
},
/**
* @param {OpenLayers.Map} map
*/
setMap: function(map) {
OpenLayers.Control.PanZoom.prototype.setMap.apply(this, arguments);
this.map.events.register("changebaselayer", this, this.redraw);
},
/** clear the div and start over.
*
*/
redraw: function() {
if (this.div != null) {
this.div.innerHTML = "";
}
this.draw();
},
/**
* @param {OpenLayers.Pixel} px
*/
draw: function(px) {
// initialize our internal div
OpenLayers.Control.prototype.draw.apply(this, arguments);
px = this.position;
px = this.position.clone();
// place the controls
this.buttons = new Array();
@@ -58,9 +78,9 @@ OpenLayers.Control.PanZoomBar.prototype =
var imgLocation = OpenLayers.Util.getImagesLocation();
var id = "OpenLayers_Control_PanZoomBar_Slider" + this.map.id;
var zoomsToEnd = this.map.getNumZoomLevels() - 1 - this.map.getZoom();
var slider = OpenLayers.Util.createAlphaImageDiv(id,
centered.add(-1,
(this.map.getZoomLevels())*this.zoomStopHeight),
centered.add(-1, zoomsToEnd * this.zoomStopHeight),
new OpenLayers.Size(20,9),
imgLocation+"slider.png",
"absolute");
@@ -74,7 +94,7 @@ OpenLayers.Control.PanZoomBar.prototype =
this.sliderEvents.register("click", this, this.doubleClick);
sz = new OpenLayers.Size();
sz.h = this.zoomStopHeight*(this.map.getZoomLevels()+1);
sz.h = this.zoomStopHeight * this.map.getNumZoomLevels();
sz.w = this.zoomStopWidth;
var div = null
@@ -110,7 +130,7 @@ OpenLayers.Control.PanZoomBar.prototype =
this.map.events.register("zoomend", this, this.moveZoomBar);
centered = centered.add(0,
this.zoomStopHeight*(this.map.getZoomLevels()+1));
this.zoomStopHeight * this.map.getNumZoomLevels());
return centered;
},
/*
@@ -127,10 +147,11 @@ OpenLayers.Control.PanZoomBar.prototype =
* and sets the zoom level appropriately.
*/
divClick: function (evt) {
if (!Event.isLeftClick(evt)) return;
var y = evt.xy.y;
var top = Position.page(evt.object)[1];
var levels = Math.floor((y - top)/this.zoomStopHeight);
this.map.zoomTo(this.map.getZoomLevels() - levels);
this.map.zoomTo((this.map.getNumZoomLevels() -1) - levels);
Event.stop(evt);
},
@@ -139,10 +160,11 @@ OpenLayers.Control.PanZoomBar.prototype =
* event listener for clicks on the slider
*/
zoomBarDown:function(evt) {
if (!Event.isLeftClick(evt)) return;
this.map.events.register("mousemove", this, this.passEventToSlider);
this.map.events.register("mouseup", this, this.passEventToSlider);
this.mouseDragStart = evt.xy.copyOf();
this.zoomStart = evt.xy.copyOf();
this.mouseDragStart = evt.xy.clone();
this.zoomStart = evt.xy.clone();
this.div.style.cursor = "move";
Event.stop(evt);
},
@@ -162,9 +184,9 @@ OpenLayers.Control.PanZoomBar.prototype =
var newTop = parseInt(this.slider.style.top) - deltaY;
this.slider.style.top = newTop+"px";
}
this.mouseDragStart = evt.xy.copyOf();
this.mouseDragStart = evt.xy.clone();
Event.stop(evt);
}
Event.stop(evt);
},
/*
@@ -173,10 +195,11 @@ OpenLayers.Control.PanZoomBar.prototype =
* and switch to it.
*/
zoomBarUp:function(evt) {
if (!Event.isLeftClick(evt)) return;
if (this.zoomStart) {
this.div.style.cursor="default";
this.map.events.remove("mousemove");
this.map.events.remove("mouseup");
this.map.events.unregister("mouseup", this, this.passEventToSlider);
this.map.events.unregister("mousemove", this, this.passEventToSlider);
var deltaY = this.zoomStart.y - evt.xy.y
this.map.zoomTo(this.map.zoom + Math.round(deltaY/this.zoomStopHeight));
this.moveZoomBar();
@@ -190,8 +213,8 @@ OpenLayers.Control.PanZoomBar.prototype =
*/
moveZoomBar:function() {
var newTop =
(this.map.getZoomLevels() - this.map.getZoom()) * this.zoomStopHeight
+ this.startTop + 1;
((this.map.getNumZoomLevels()-1) - this.map.getZoom()) *
this.zoomStopHeight + this.startTop + 1;
this.slider.style.top = newTop + "px";
},

View File

@@ -0,0 +1,77 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
* text of the license. */
/**
* @class
*
* @requires OpenLayers/Control.js
*/
OpenLayers.Control.Permalink = Class.create();
OpenLayers.Control.Permalink.prototype =
Object.extend( new OpenLayers.Control(), {
/** @type DOMElement */
element: null,
/** @type String */
base: '',
/**
* @constructor
*
* @param {DOMElement} element
* @param {String} base
*/
initialize: function(element, base) {
OpenLayers.Control.prototype.initialize.apply(this, arguments);
this.element = element;
if (base) this.base = base;
},
/**
* @type DOMElement
*/
draw: function() {
OpenLayers.Control.prototype.draw.apply(this, arguments);
var args = OpenLayers.Util.getArgs();
if (args.lat && args.lon) {
this.map.setCenter(
new OpenLayers.LonLat(parseFloat(args.lon), parseFloat(args.lat))
);
}
if (args.zoom) {
this.map.zoomTo(parseInt(args.zoom));
}
if (!this.element) {
this.element = document.createElement("a");
this.div.style.right = "3px";
this.div.style.bottom = "3px";
this.div.style.left = "";
this.div.style.top = "";
this.div.style.display = "block";
this.div.style.position = "absolute";
this.element.style.fontSize="smaller";
this.element.innerHTML = "Permalink";
this.element.href="";
this.div.appendChild(this.element);
}
this.map.events.register( 'moveend', this, this.updateLink);
return this.div;
},
/**
*
*/
updateLink: function() {
var center = this.map.getCenter();
var zoom = this.map.getZoom();
var lat = Math.round(center.lat*100000)/100000;
var lon = Math.round(center.lon*100000)/100000;
this.element.href = this.base+"?lat="+lat+"&lon="+lon+"&zoom="+zoom;
},
/** @final @type String */
CLASS_NAME: "OpenLayers.Control.Permalink"
});

View File

@@ -0,0 +1,68 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
* text of the license. */
/**
* @class
*
* @requires OpenLayers/Control.js
*/
OpenLayers.Control.Scale = Class.create();
OpenLayers.Control.Scale.prototype =
Object.extend( new OpenLayers.Control(), {
/** @type DOMElement */
element: null,
/**
* @constructor
*
* @param {DOMElement} element
* @param {String} base
*/
initialize: function(element) {
OpenLayers.Control.prototype.initialize.apply(this, arguments);
this.element = element;
},
/**
* @type DOMElement
*/
draw: function() {
OpenLayers.Control.prototype.draw.apply(this, arguments);
if (!this.element) {
this.element = document.createElement("div");
this.div.style.right = "3px";
this.div.style.bottom = "2em";
this.div.style.left = "";
this.div.style.top = "";
this.div.style.display = "block";
this.div.style.position = "absolute";
this.element.style.fontSize="smaller";
this.div.appendChild(this.element);
}
this.map.events.register( 'moveend', this, this.updateScale);
this.updateScale();
return this.div;
},
/**
*
*/
updateScale: function() {
var scale = this.map.getScale();
if (!scale) return;
if (scale >= 9500 && scale <= 950000) {
scale = Math.round(scale / 1000) + "K";
} else if (scale >= 950000) {
scale = Math.round(scale / 1000000) + "M";
} else {
scale = Math.round(scale / 100) * 100;
}
this.element.innerHTML = "Scale = 1 : " + scale;
},
/** @final @type String */
CLASS_NAME: "OpenLayers.Control.Scale"
});

View File

@@ -1,10 +1,14 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
* text of the license. */
OpenLayers.Events = Class.create();
/**
* @class
*/
OpenLayers.Events = Class.create();
OpenLayers.Events.prototype = {
// Array: supported events
/** @final @type Array: supported events */
BROWSER_EVENTS: [
"mouseover", "mouseout",
"mousedown", "mouseup", "mousemove",
@@ -12,113 +16,201 @@ OpenLayers.Events.prototype = {
"resize", "focus", "blur"
],
// hash of Array(Function): events listener functions
/** Hashtable of Array(Function): events listener functions
* @type Object */
listeners: null,
// Object: the code object issuing application events
/** @type Object: the code object issuing application events */
object: null,
// DOMElement: the DOM element receiving browser events
div: null,
/** @type DOMElement: the DOM element receiving browser events */
element: null,
// Array: list of support application events
/** @type Array: list of support application events */
eventTypes: null,
/**
* @param {OpenLayers.Map} map
* @param {DOMElement} div
*/
initialize: function (object, div, eventTypes) {
this.listeners = {};
* @constructor
*
* @param {OpenLayers.Map} object The js object to which this Events object
* is being added
* @param {DOMElement} element A dom element to respond to browser events
* @param {Array} eventTypes Array of custom application events
*/
initialize: function (object, element, eventTypes) {
this.object = object;
this.div = div;
this.element = element;
this.eventTypes = eventTypes;
if (eventTypes) {
for (var i = 0; i < this.eventTypes.length; i++) {
// create a listener list for every custom application event
this.listeners[ this.eventTypes[i] ] = [];
}
}
this.listeners = new Object();
// if eventTypes is specified, create a listeners list for each
// custom application event.
if (this.eventTypes != null)
for (var i = 0; i < this.eventTypes.length; i++)
this.listeners[ this.eventTypes[i] ] = new Array();
// if a dom element is specified, add a listeners list
// for browser events on the element and register them
if (this.element != null)
this.attachToElement(element);
},
/**
* @param {HTMLDOMElement} element a DOM element to attach browser events to
*/
attachToElement: function (element) {
for (var i = 0; i < this.BROWSER_EVENTS.length; i++) {
var eventType = this.BROWSER_EVENTS[i];
// every browser event has a corresponding application event
// (whether it's listened for or not).
this.listeners[ eventType ] = [];
if (this.listeners[eventType] == null)
this.listeners[eventType] = new Array();
Event.observe(div, eventType,
// use Prototype to register the event cross-browser
Event.observe(element, eventType,
this.handleBrowserEvent.bindAsEventListener(this));
}
// disable dragstart in IE so that mousedown/move/up works normally
Event.observe(div, "dragstart", Event.stop);
Event.observe(element, "dragstart", Event.stop);
},
/**
* @param {str} type
* @param {Object} obj
* @param {Function} func
*/
* @param {String} type Name of the event to register
* @param {Object} obj The object to bind the context to for the callback#.
* If no object is specified, default is the Events's
* 'object' property.
* @param {Function} func The callback function. If no callback is
* specified, this function does nothing.
*
* #When the event is triggered, the 'func' function will be called, in the
* context of 'obj'. Imagine we were to register an event, specifying an
* OpenLayers.Bounds Object as 'obj'. When the event is triggered, the
* context in the callback function will be our Bounds object. This means
* that within our callback function, we can access the properties and
* methods of the Bounds object through the "this" variable. So our
* callback could execute something like:
*
* leftStr = "Left: " + this.left;
*
* or
*
* centerStr = "Center: " + this.getCenterLonLat();
*
*/
register: function (type, obj, func) {
if (func == null) {
obj = this.object;
func = obj;
if (func != null) {
if (obj == null) {
obj = this.object;
}
var listeners = this.listeners[type];
if (listeners != null) {
listeners.push( {obj: obj, func: func} );
}
}
var listeners = this.listeners[type];
listeners.push( {obj: obj, func: func} );
},
/**
* @param {String} type
* @param {Object} obj If none specified, defaults to this.object
* @param {Function} func
*/
unregister: function (type, obj, func) {
if (obj == null) {
obj = this.object;
}
var listeners = this.listeners[type];
for (var i = 0; i < listeners.length; i++) {
if (listeners[i].obj == obj && listeners[i].type == type) {
listeners.splice(i, 1);
break;
if (listeners != null) {
for (var i = 0; i < listeners.length; i++) {
if (listeners[i].obj == obj && listeners[i].func == func) {
listeners.splice(i, 1);
break;
}
}
}
},
/** Remove all listeners for a given event type. If type is not registered,
* does nothing.
*
* @param {String} type
*/
remove: function(type) {
this.listeners[type].pop();
if (this.listeners[type] != null) {
this.listeners[type] = new Array();
}
},
/**
* @param {event} evt
*/
/** Trigger a specified registered event
*
* @param {String} type
* @param {Event} evt
*/
triggerEvent: function (type, evt) {
// prep evt object with object & div references
if (evt == null) {
evt = new Object();
}
evt.object = this.object;
evt.element = this.element;
// execute all callbacks registered for specified type
var listeners = this.listeners[type];
if ((listeners != null) && (listeners.length > 0)) {
for (var i = 0; i < listeners.length; i++) {
var callback = listeners[i];
var continueChain;
if (callback.obj != null) {
// use the 'call' method to bind the context to callback.obj
continueChain = callback.func.call(callback.obj, evt);
} else {
continueChain = callback.func(evt);
}
if ((continueChain != null) && (continueChain == false)) {
// if callback returns false, execute no more callbacks.
break;
}
}
// don't fall through to other DOM elements
Event.stop(evt);
}
},
/** Basically just a wrapper to the triggerEvent() function, but takes
* care to set a property 'xy' on the event with the current mouse
* position.
*
* @private
*
* @param {Event} evt
*/
handleBrowserEvent: function (evt) {
evt.xy = this.getMousePosition(evt);
this.triggerEvent(evt.type, evt)
},
/**
* @param {event} evt
*
* @return {OpenLayers.Pixel}
*/
* @private
*
* @param {Event} evt
*
* @returns The current xy coordinate of the mouse, adjusted for offsets
* @type OpenLayers.Pixel
*/
getMousePosition: function (evt) {
if (!this.div.offsets) {
this.div.offsets = Position.page(this.div);
if (!this.element.offsets) {
this.element.offsets = Position.page(this.element);
}
return new OpenLayers.Pixel(
evt.clientX - this.div.offsets[0],
evt.clientY - this.div.offsets[1]);
(evt.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft)) - this.element.offsets[0],
(evt.clientY + (document.documentElement.scrollTop || document.body.scrollTop)) - this.element.offsets[1]
);
},
/**
* @param {str} type
* @param {event} evt
*/
triggerEvent: function (type, evt) {
if (evt == null) {
evt = {};
}
evt.object = this.object;
evt.div = this.div;
var listeners = this.listeners[type];
for (var i = 0; i < listeners.length; i++) {
var callback = listeners[i];
var continueChain = callback.func.call(callback.obj, evt);
if (continueChain != null && !continueChain) break;
}
}
/** @final @type String */
CLASS_NAME: "OpenLayers.Events"
};

View File

@@ -1,8 +1,11 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
* text of the license. */
/**
* @class
*
* @requires OpenLayers/Util.js
*/
OpenLayers.Feature = Class.create();
OpenLayers.Feature.prototype= {
@@ -32,15 +35,14 @@ OpenLayers.Feature.prototype= {
* @constructor
*
* @param {OpenLayers.Layer} layer
* @param {String} id
* @param {OpenLayers.LonLat} lonlat
* @param {Object} data
*/
initialize: function(layer, lonlat, data, id) {
initialize: function(layer, lonlat, data) {
this.layer = layer;
this.lonlat = lonlat;
this.data = (data != null) ? data : new Object();
this.id = (id ? id : 'f' + Math.random());
this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");
},
/**

View File

@@ -1,57 +1,66 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
* text of the license. */
/**
* @class
*/
OpenLayers.Feature.WFS = Class.create();
OpenLayers.Feature.WFS.prototype =
Object.extend( new OpenLayers.Feature(), {
/**
* @constructor
*
* @param {OpenLayers.Layer} layer
* @param {XMLNode} xmlNode
*/
initialize: function(layer, xmlNode) {
var newArguments = arguments;
if (arguments.length > 0) {
var data = this.processXMLNode(xmlNode);
newArguments = new Array(layer, data.lonlat, data, data.id)
}
OpenLayers.Feature.prototype.initialize.apply(this, newArguments);
if (arguments.length > 0) {
this.createMarker();
this.layer.addMarker(this.marker);
}
},
destroy: function() {
if (this.marker != null) {
this.layer.removeMarker(this.marker);
}
OpenLayers.Feature.prototype.destroy.apply(this, arguments);
},
/**
* @param {XMLNode} xmlNode
*
* @returns Data Object with 'id', 'lonlat', and private properties set
* @type Object
*/
processXMLNode: function(xmlNode) {
//this should be overridden by subclasses
// must return an Object with 'id' and 'lonlat' values set
},
/** @final @type String */
CLASS_NAME: "OpenLayers.Feature.WFS"
});
/**
* @class
*
* @requires OpenLayers/Feature.js
*/
OpenLayers.Feature.WFS = Class.create();
OpenLayers.Feature.WFS.prototype =
Object.extend( new OpenLayers.Feature(), {
/**
* @constructor
*
* @param {OpenLayers.Layer} layer
* @param {XMLNode} xmlNode
*/
initialize: function(layer, xmlNode) {
var newArguments = arguments;
if (arguments.length > 0) {
var data = this.processXMLNode(xmlNode);
newArguments = new Array(layer, data.lonlat, data)
}
OpenLayers.Feature.prototype.initialize.apply(this, newArguments);
if (arguments.length > 0) {
this.createMarker();
this.layer.addMarker(this.marker);
}
},
destroy: function() {
if (this.marker != null) {
this.layer.removeMarker(this.marker);
}
OpenLayers.Feature.prototype.destroy.apply(this, arguments);
},
/**
* @param {XMLNode} xmlNode
*
* @returns Data Object with 'id', 'lonlat', and private properties set
* @type Object
*/
processXMLNode: function(xmlNode) {
//this should be overridden by subclasses
// must return an Object with 'id' and 'lonlat' values set
var point = xmlNode.getElementsByTagName("Point");
var text = OpenLayers.Util.getXmlNodeValue(point[0].getElementsByTagName("coordinates")[0]);
var floats = text.split(",");
return {lonlat: new OpenLayers.LonLat(parseFloat(floats[0]),
parseFloat(floats[1])),
id: null};
},
/** @final @type String */
CLASS_NAME: "OpenLayers.Feature.WFS"
});

View File

@@ -1,9 +1,10 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
* text of the license. */
/**
* @class
*/
* @class
*/
OpenLayers.Icon = Class.create();
OpenLayers.Icon.prototype = {
@@ -53,7 +54,10 @@ OpenLayers.Icon.prototype = {
* @type OpenLayers.Icon
*/
clone: function() {
return new OpenLayers.Icon(this.size, this.url, this.offset);
return new OpenLayers.Icon(this.url,
this.size,
this.offset,
this.calculateOffset);
},
/**
@@ -92,15 +96,28 @@ OpenLayers.Icon.prototype = {
this.px = px;
}
if ((this.px != null) && (this.imageDiv != null)) {
if (this.calculateOffset) {
this.offset = this.calculateOffset(this.size);
if (this.imageDiv != null) {
if (this.px == null) {
this.display(false);
} else {
if (this.calculateOffset) {
this.offset = this.calculateOffset(this.size);
}
var offsetPx = this.px.offset(this.offset);
OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv, null, offsetPx);
this.display(true);
}
var offsetPx = this.px.offset(this.offset);
OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv, null, offsetPx);
}
},
/** Hide or show the icon
*
* @param {Boolean} display
*/
display: function(display) {
this.imageDiv.style.display = (display) ? "" : "none";
},
/** @final @type String */
CLASS_NAME: "OpenLayers.Icon"
};

View File

@@ -1,34 +1,104 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
* text of the license. */
/**
* @class
*/
OpenLayers.Layer = Class.create();
OpenLayers.Layer.prototype = {
/** @type String */
id: null,
/** @type String */
name: null,
/** @type DOMElement */
div: null,
/** This variable is set in map.addLayer, not within the layer itself
* @type OpenLayers.Map */
/** This variable is set when the layer is added to the map, via the
* accessor function setMap()
*
* @type OpenLayers.Map */
map: null,
/** Whether or not the layer is a base layer. This should be set
* individually by all subclasses.
* Default is false
*
* @type Boolean
*/
isBaseLayer: false,
/** asserts whether or not the layer's images have an alpha channel
*
* @type boolean */
alpha: false,
// OPTIONS
/** @type Array */
options: null,
/** @type String */
projection: null,
/** @type String */
units: null,
/** @type Array */
scales: null,
/** @type Array */
resolutions: null,
/** @type OpenLayers.Bounds */
maxExtent: null,
/** @type OpenLayers.Bounds */
minExtent: null,
/** @type float */
maxResolution: null,
/** @type float */
minResolution: null,
/** @type int */
numZoomLevels: null,
/** @type float */
minScale: null,
/** @type float */
maxScale: null,
/**
* @constructor
*
* @param {String} name
* @param {Object} options Hashtable of extra options to tag onto the layer
*/
initialize: function(name) {
initialize: function(name, options) {
if (arguments.length > 0) {
//store a copy of the custom options for later cloning
this.options = Object.extend(new Object(), options);
//add options to layer
Object.extend(this, this.options);
this.name = name;
this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");
if (this.div == null) {
this.div = OpenLayers.Util.createDiv();
this.div.style.width = "100%";
this.div.style.height = "100%";
this.div.id = this.id;
}
}
},
@@ -42,33 +112,102 @@ OpenLayers.Layer.prototype = {
this.map.removeLayer(this);
}
this.map = null;
this.name = null;
this.div = null;
this.options = null;
},
/**
* @params {OpenLayers.Bounds} bound
* @params {Boolean} zoomChanged tells when zoom has changed, as layers have to do some init work in that case.
/**
* @returns An exact clone of this OpenLayers.Layer
* @type OpenLayers.Layer
*/
moveTo: function (bound, zoomChanged) {
// not implemented here
return;
clone: function (obj) {
if (obj == null) {
obj = new OpenLayers.Layer(this.name, this.options);
}
// catch any randomly tagged-on properties
OpenLayers.Util.applyDefaults(obj, this);
// a cloned layer should never have its map property set
// because it has not been added to a map yet.
obj.map = null;
return obj;
},
/**
* @param {String} newName
*/
setName: function(newName) {
this.name = newName;
if (this.map != null)
this.map.events.triggerEvent("changelayer");
},
/**
* @param {Object} newOptions
*/
addOptions: function (newOptions) {
// update our copy for clone
Object.extend(this.options, newOptions);
// add new options to this
Object.extend(this, this.options);
},
/**
*
*/
onMapResize: function() {
//this function can be implemented by subclasses
},
/**
* @param {OpenLayers.Bounds} bound
* @param {Boolean} zoomChanged tells when zoom has changed, as layers
* have to do some init work in that case.
* @param {Boolean} minor
*/
moveTo:function(bounds, zoomChanged, minor) {
//this function can be implemented by subclasses.
},
/** Set the map property for the layer. This is done through an accessor
* so that subclasses can override this and take special action once
* they have their map variable set.
*
* Here we take care to bring over any of the necessary default properties
* from the map.
*
* @param {OpenLayers.Map} map
*/
setMap: function(map) {
this.map = map;
var properties = new Array(
'projection', 'units',
'scales', 'resolutions',
'maxScale', 'minScale',
'maxResolution', 'minResolution',
'minExtent', 'maxExtent',
'numZoomLevels'
);
if (this.map.maxZoomLevel && !this.numZoomLevels) {
this.numZoomLevels = this.map.maxZoomLevel + 1;
}
for(var i=0; i < properties.length; i++) {
if (this[properties[i]] == null) {
this[properties[i]] = this.map[properties[i]];
}
}
if (this.isBaseLayer) {
this.initResolutions();
}
},
/**
* @returns Whether or not the layer is a base layer. This should be
* determined individually by all subclasses.
* @type Boolean
*/
isBaseLayer: function() {
//this function should be implemented by all subclasses.
},
/**
* @returns Whether or not the layer is visible
* @type Boolean
@@ -78,15 +217,238 @@ OpenLayers.Layer.prototype = {
},
/**
* @param {bool} visible
*/
setVisibility: function(visible) {
this.div.style.display = (visible) ? "block" : "none";
if ((visible) && (this.map != null)) {
this.moveTo(this.map.getExtent());
* @param {Boolean} visible
* @param {Boolean} noEvent
*/
setVisibility: function(visible, noEvent) {
if (visible != this.getVisibility()) {
this.div.style.display = (visible) ? "block" : "none";
if ((visible) && (this.map != null)) {
var extent = this.map.getExtent();
if (extent != null) {
this.moveTo(this.map.getExtent(), true);
}
}
if ((this.map != null) &&
((noEvent == null) || (noEvent == false))) {
this.map.events.triggerEvent("changelayer");
}
}
},
/**
* @param {Boolean} isBaseLayer
*/
setIsBaseLayer: function(isBaseLayer) {
this.isBaseLayer = isBaseLayer;
if (this.map != null) {
this.map.events.triggerEvent("changelayer");
}
},
/********************************************************/
/* */
/* Baselayer Functions */
/* */
/********************************************************/
/** This method's responsibility is to set up the 'resolutions' array
* for the layer -- this array is what the layer will use to interface
* between the zoom levels of the map and the resolution display of the
* layer.
*
* The user has several options that determine how the array is set up.
*
* For a detailed explanation, see the following wiki from the
* openlayers.org homepage:
*
* http://trac.openlayers.org/wiki/SettingZoomLevels
*
* @private
*/
initResolutions: function() {
if ((this.scales != null) || (this.resolutions != null)) {
//preset levels
if (this.scales != null) {
this.resolutions = new Array();
for(var i = 0; i < this.scales.length; i++) {
this.resolutions[i] =
OpenLayers.Util.getResolutionFromScale(this.scales[i],
this.units);
}
}
this.numZoomLevels = this.resolutions.length;
} else {
//maxResolution and numZoomLevels
this.resolutions = new Array();
// determine maxResolution
if (this.minScale) {
this.maxResolution =
OpenLayers.Util.getResolutionFromScale(this.minScale,
this.units);
} else if (this.maxResolution == "auto") {
var viewSize = this.map.getSize();
var wRes = this.maxExtent.getWidth() / viewSize.w;
var hRes = this.maxExtent.getHeight()/ viewSize.h;
this.maxResolution = Math.max(wRes, hRes);
}
// determine minResolution
if (this.maxScale != null) {
this.minResolution =
OpenLayers.Util.getResolutionFromScale(this.maxScale);
} else if ((this.minResolution == "auto") &&
(this.minExtent != null)){
var viewSize = this.map.getSize();
var wRes = this.minExtent.getWidth() / viewSize.w;
var hRes = this.minExtent.getHeight()/ viewSize.h;
this.minResolution = Math.max(wRes, hRes);
}
// determine numZoomLevels
if (this.minResolution != null) {
var ratio = this.maxResolution / this.minResolution;
this.numZoomLevels =
Math.floor(Math.log(ratio) / Math.log(2)) + 1;
}
// now we have numZoomLevels and maxResolution,
// we can populate the resolutions array
for (var i=0; i < this.numZoomLevels; i++) {
this.resolutions.push(this.maxResolution / Math.pow(2, i));
}
}
this.resolutions = this.resolutions.sort().reverse();
},
/**
* @returns The currently selected resolution of the map, taken from the
* resolutions array, indexed by current zoom level.
* @type float
*/
getResolution: function() {
var zoom = this.map.getZoom();
return this.resolutions[zoom];
},
/** Calculates based on resolution, center, and mapsize
*
* @param {float} resolution Specific resolution to get an extent for.
* If null, this.getResolution() is called
* @returns A Bounds object which represents the lon/lat bounds of the
* current viewPort.
* @type OpenLayers.Bounds
*/
getExtent: function(resolution) {
var extent = null;
var center = this.map.getCenter();
if (center != null) {
if (resolution == null) {
resolution = this.getResolution();
}
var size = this.map.getSize();
var w_deg = size.w * resolution;
var h_deg = size.h * resolution;
extent = new OpenLayers.Bounds(center.lon - w_deg / 2,
center.lat - h_deg / 2,
center.lon + w_deg / 2,
center.lat + h_deg / 2);
}
return extent;
},
/**
* @param {OpenLayers.Bounds} bounds
*
* @returns The index of the zoomLevel (entry in the resolutions array)
* that still contains the passed-in extent. We do this by
* calculating the ideal resolution for the given exteng (based
* on the map size) and then find the smallest resolution that
* is greater than this ideal resolution.
* @type int
*/
getZoomForExtent: function(extent) {
var viewSize = this.map.getSize();
var idealResolution = Math.max( extent.getWidth() / viewSize.w,
extent.getHeight() / viewSize.h );
return this.getZoomForResolution(idealResolution);
},
/**
* @param {float} resolution
*
* @returns The index of the zoomLevel (entry in the resolutions array)
* that is the smallest resolution that is greater than the
* passed-in resolution.
* @type int
*/
getZoomForResolution: function(resolution) {
for(var i=1; i <= this.resolutions.length; i++) {
if ( this.resolutions[i] < resolution) {
break;
}
}
return (i - 1);
},
/**
* @param {OpenLayers.Pixel} viewPortPx
*
* @returns An OpenLayers.LonLat which is the passed-in view port
* OpenLayers.Pixel, translated into lon/lat by the layer
* @type OpenLayers.LonLat
*/
getLonLatFromViewPortPx: function (viewPortPx) {
var size = this.map.getSize();
var center = this.map.getCenter();
var res = this.map.getResolution();
var delta_x = viewPortPx.x - (size.w / 2);
var delta_y = viewPortPx.y - (size.h / 2);
return new OpenLayers.LonLat(center.lon + delta_x * res ,
center.lat - delta_y * res);
},
/**
* @param {OpenLayers.LonLat} lonlat
*
* @returns An OpenLayers.Pixel which is the passed-in OpenLayers.LonLat,
* translated into view port pixels
* @type OpenLayers.Pixel
*/
getViewPortPxFromLonLat: function (lonlat) {
var resolution = this.map.getResolution();
var extent = this.map.getExtent();
return new OpenLayers.Pixel(
Math.round(1/resolution * (lonlat.lon - extent.left)),
Math.round(1/resolution * (extent.top - lonlat.lat))
);
},
/**
* Sets the opacity for the entire layer (all images)
* @param {Float} opacity
*/
setOpacity: function(opacity) {
this.opacity = opacity;
for(var i=0; i<this.div.childNodes.length; ++i) {
var element = this.div.childNodes[i];
OpenLayers.Util.setOpacity(element, opacity);
}
},
/** @final @type String */
CLASS_NAME: "OpenLayers.Layer"
};

View File

@@ -0,0 +1,47 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
* text of the license. */
/**
* @class
*
* @requires OpenLayers/Layer.js
* @requires OpenLayers/Layer/Markers.js
*/
OpenLayers.Layer.Boxes = Class.create();
OpenLayers.Layer.Boxes.prototype =
Object.extend( new OpenLayers.Layer.Markers(), {
initialize: function () {
OpenLayers.Layer.Markers.prototype.initialize.apply(this, arguments);
},
/** Calculate the pixel location for the marker, create it, and
* add it to the layer's div
*
* @private
*
* @param {OpenLayers.Marker.Box} marker
*/
drawMarker: function(marker) {
var bounds = marker.bounds;
var topleft = this.map.getLayerPxFromLonLat(
new OpenLayers.LonLat(bounds.left, bounds.top));
var botright = this.map.getLayerPxFromLonLat(
new OpenLayers.LonLat(bounds.right, bounds.bottom));
if (botright == null || topleft == null) {
marker.display(false);
} else {
var sz = new OpenLayers.Size(
botright.x - topleft.x, botright.y - topleft.y);
var markerDiv = marker.draw(topleft, sz);
if (!marker.drawn) {
this.div.appendChild(markerDiv);
marker.drawn = true;
}
}
},
/** @final @type String */
CLASS_NAME: "OpenLayers.Layer.Boxes"
});

Some files were not shown because too many files have changed in this diff Show More