How to use open method in Cypress

Best JavaScript code snippet using cypress

Run Cypress automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

OpenLayers.js

Source: OpenLayers.js Github

copy
1/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for 
2 * full list of contributors). Published under the Clear BSD license.  
3 * See http://svn.openlayers.org/trunk/openlayers/license.txt for the
4 * full text of the license. */
5
6/* 
7 * @requires OpenLayers/BaseTypes.js
8 * @requires OpenLayers/Lang/en.js
9 * @requires OpenLayers/Console.js
10 */
11 
12/*
13 * TODO: In 3.0, we will stop supporting build profiles that include
14 * OpenLayers.js. This means we will not need the singleFile and scriptFile
15 * variables, because we don't have to handle the singleFile case any more.
16 */
17
18(function() {
19    /**
20     * Before creating the OpenLayers namespace, check to see if
21     * OpenLayers.singleFile is true.  This occurs if the
22     * OpenLayers/SingleFile.js script is included before this one - as is the
23     * case with old single file build profiles that included both
24     * OpenLayers.js and OpenLayers/SingleFile.js.
25     */
26    var singleFile = (typeof OpenLayers == "object" && OpenLayers.singleFile);
27    
28    /**
29     * Relative path of this script.
30     */
31    var scriptName = (!singleFile) ? "lib/OpenLayers.js" : "OpenLayers.js";
32
33    /*
34     * If window.OpenLayers isn't set when this script (OpenLayers.js) is
35     * evaluated (and if singleFile is false) then this script will load
36     * *all* OpenLayers scripts. If window.OpenLayers is set to an array
37     * then this script will attempt to load scripts for each string of
38     * the array, using the string as the src of the script.
39     *
40     * Example:
41     * (code)
42     *     <script type="text/javascript">
43     *         window.OpenLayers = [
44     *             "OpenLayers/Util.js",
45     *             "OpenLayers/BaseTypes.js"
46     *         ];
47     *     </script>
48     *     <script type="text/javascript" src="../lib/OpenLayers.js"></script>
49     * (end)
50     * In this example OpenLayers.js will load Util.js and BaseTypes.js only.
51     */
52    var jsFiles = window.OpenLayers;
53
54    /**
55     * Namespace: OpenLayers
56     * The OpenLayers object provides a namespace for all things OpenLayers
57     */
58    window.OpenLayers = {
59        /**
60         * Method: _getScriptLocation
61         * Return the path to this script. This is also implemented in
62         * OpenLayers/SingleFile.js
63         *
64         * Returns:
65         * {String} Path to this script
66         */
67        _getScriptLocation: (function() {
68            var r = new RegExp("(^|(.*?\\/))(" + scriptName + ")(\\?|$)"),
69                s = document.getElementsByTagName('script'),
70                src, m, l = "";
71            for(var i=0, len=s.length; i<len; i++) {
72                src = s[i].getAttribute('src');
73                if(src) {
74                    var m = src.match(r);
75                    if(m) {
76                        l = m[1];
77                        break;
78                    }
79                }
80            }
81            return (function() { return l; });
82        })()
83    };
84
85    /**
86     * OpenLayers.singleFile is a flag indicating this file is being included
87     * in a Single File Library build of the OpenLayers Library.
88     * 
89     * When we are *not* part of a SFL build we dynamically include the
90     * OpenLayers library code.
91     * 
92     * When we *are* part of a SFL build we do not dynamically include the 
93     * OpenLayers library code as it will be appended at the end of this file.
94     */
95    if(!singleFile) {
96        if (!jsFiles) {
97            jsFiles = [
98                "OpenLayers/BaseTypes/Class.js",
99                "OpenLayers/Util.js",
100                "OpenLayers/BaseTypes.js",
101                "OpenLayers/BaseTypes/Bounds.js",
102                "OpenLayers/BaseTypes/Date.js",
103                "OpenLayers/BaseTypes/Element.js",
104                "OpenLayers/BaseTypes/LonLat.js",
105                "OpenLayers/BaseTypes/Pixel.js",
106                "OpenLayers/BaseTypes/Size.js",
107                "OpenLayers/Console.js",
108                "OpenLayers/Tween.js",
109                "OpenLayers/Kinetic.js",
110                "Rico/Corner.js",
111                "Rico/Color.js",
112                "OpenLayers/Ajax.js",
113                "OpenLayers/Events.js",
114                "OpenLayers/Request.js",
115                "OpenLayers/Request/XMLHttpRequest.js",
116                "OpenLayers/Projection.js",
117                "OpenLayers/Map.js",
118                "OpenLayers/Layer.js",
119                "OpenLayers/Icon.js",
120                "OpenLayers/Marker.js",
121                "OpenLayers/Marker/Box.js",
122                "OpenLayers/Popup.js",
123                "OpenLayers/Tile.js",
124                "OpenLayers/Tile/Image.js",
125                "OpenLayers/Tile/Image/IFrame.js",
126                "OpenLayers/Tile/WFS.js",
127                "OpenLayers/Layer/Image.js",
128                "OpenLayers/Layer/SphericalMercator.js",
129                "OpenLayers/Layer/EventPane.js",
130                "OpenLayers/Layer/FixedZoomLevels.js",
131                "OpenLayers/Layer/Google.js",
132                "OpenLayers/Layer/Google/v3.js",
133                "OpenLayers/Layer/VirtualEarth.js",
134                "OpenLayers/Layer/Yahoo.js",
135                "OpenLayers/Layer/HTTPRequest.js",
136                "OpenLayers/Layer/Grid.js",
137                "OpenLayers/Layer/MapGuide.js",
138                "OpenLayers/Layer/MapServer.js",
139                "OpenLayers/Layer/MapServer/Untiled.js",
140                "OpenLayers/Layer/KaMap.js",
141                "OpenLayers/Layer/KaMapCache.js",
142                "OpenLayers/Layer/MultiMap.js",
143                "OpenLayers/Layer/Markers.js",
144                "OpenLayers/Layer/Text.js",
145                "OpenLayers/Layer/WorldWind.js",
146                "OpenLayers/Layer/ArcGIS93Rest.js",
147                "OpenLayers/Layer/WMS.js",
148                "OpenLayers/Layer/WMS/Untiled.js",
149                "OpenLayers/Layer/WMS/Post.js",
150                "OpenLayers/Layer/WMTS.js",
151                "OpenLayers/Layer/ArcIMS.js",
152                "OpenLayers/Layer/GeoRSS.js",
153                "OpenLayers/Layer/Boxes.js",
154                "OpenLayers/Layer/XYZ.js",
155                "OpenLayers/Layer/Bing.js",
156                "OpenLayers/Layer/TMS.js",
157                "OpenLayers/Layer/TileCache.js",
158                "OpenLayers/Layer/Zoomify.js",
159                "OpenLayers/Layer/ArcGISCache.js",
160                "OpenLayers/Popup/Anchored.js",
161                "OpenLayers/Popup/AnchoredBubble.js",
162                "OpenLayers/Popup/Framed.js",
163                "OpenLayers/Popup/FramedCloud.js",
164                "OpenLayers/Feature.js",
165                "OpenLayers/Feature/Vector.js",
166                "OpenLayers/Feature/WFS.js",
167                "OpenLayers/Handler.js",
168                "OpenLayers/Handler/Click.js",
169                "OpenLayers/Handler/Hover.js",
170                "OpenLayers/Handler/Point.js",
171                "OpenLayers/Handler/Path.js",
172                "OpenLayers/Handler/Polygon.js",
173                "OpenLayers/Handler/Feature.js",
174                "OpenLayers/Handler/Drag.js",
175                "OpenLayers/Handler/Pinch.js",
176                "OpenLayers/Handler/RegularPolygon.js",
177                "OpenLayers/Handler/Box.js",
178                "OpenLayers/Handler/MouseWheel.js",
179                "OpenLayers/Handler/Keyboard.js",
180                "OpenLayers/Control.js",
181                "OpenLayers/Control/Attribution.js",
182                "OpenLayers/Control/Button.js",
183                "OpenLayers/Control/ZoomBox.js",
184                "OpenLayers/Control/ZoomToMaxExtent.js",
185                "OpenLayers/Control/DragPan.js",
186                "OpenLayers/Control/Navigation.js",
187                "OpenLayers/Control/PinchZoom.js",
188                "OpenLayers/Control/TouchNavigation.js",
189                "OpenLayers/Control/MouseDefaults.js",
190                "OpenLayers/Control/MousePosition.js",
191                "OpenLayers/Control/OverviewMap.js",
192                "OpenLayers/Control/KeyboardDefaults.js",
193                "OpenLayers/Control/PanZoom.js",
194                "OpenLayers/Control/PanZoomBar.js",
195                "OpenLayers/Control/ArgParser.js",
196                "OpenLayers/Control/Permalink.js",
197                "OpenLayers/Control/Scale.js",
198                "OpenLayers/Control/ScaleLine.js",
199                "OpenLayers/Control/Snapping.js",
200                "OpenLayers/Control/Split.js",
201                "OpenLayers/Control/LayerSwitcher.js",
202                "OpenLayers/Control/DrawFeature.js",
203                "OpenLayers/Control/DragFeature.js",
204                "OpenLayers/Control/ModifyFeature.js",
205                "OpenLayers/Control/Panel.js",
206                "OpenLayers/Control/SelectFeature.js",
207                "OpenLayers/Control/NavigationHistory.js",
208                "OpenLayers/Control/Measure.js",
209                "OpenLayers/Control/WMSGetFeatureInfo.js",
210                "OpenLayers/Control/WMTSGetFeatureInfo.js",
211                "OpenLayers/Control/Graticule.js",
212                "OpenLayers/Control/TransformFeature.js",
213                "OpenLayers/Control/SLDSelect.js",
214                "OpenLayers/Geometry.js",
215                "OpenLayers/Geometry/Rectangle.js",
216                "OpenLayers/Geometry/Collection.js",
217                "OpenLayers/Geometry/Point.js",
218                "OpenLayers/Geometry/MultiPoint.js",
219                "OpenLayers/Geometry/Curve.js",
220                "OpenLayers/Geometry/LineString.js",
221                "OpenLayers/Geometry/LinearRing.js",
222                "OpenLayers/Geometry/Polygon.js",
223                "OpenLayers/Geometry/MultiLineString.js",
224                "OpenLayers/Geometry/MultiPolygon.js",
225                "OpenLayers/Geometry/Surface.js",
226                "OpenLayers/Renderer.js",
227                "OpenLayers/Renderer/Elements.js",
228                "OpenLayers/Renderer/NG.js",
229                "OpenLayers/Renderer/SVG.js",
230                "OpenLayers/Renderer/SVG2.js",
231                "OpenLayers/Renderer/Canvas.js",
232                "OpenLayers/Renderer/VML.js",
233                "OpenLayers/Layer/Vector.js",
234                "OpenLayers/Layer/PointGrid.js",
235                "OpenLayers/Layer/Vector/RootContainer.js",
236                "OpenLayers/Strategy.js",
237                "OpenLayers/Strategy/Filter.js",
238                "OpenLayers/Strategy/Fixed.js",
239                "OpenLayers/Strategy/Cluster.js",
240                "OpenLayers/Strategy/Paging.js",
241                "OpenLayers/Strategy/BBOX.js",
242                "OpenLayers/Strategy/Save.js",
243                "OpenLayers/Strategy/Refresh.js",
244                "OpenLayers/Filter.js",
245                "OpenLayers/Filter/FeatureId.js",
246                "OpenLayers/Filter/Logical.js",
247                "OpenLayers/Filter/Comparison.js",
248                "OpenLayers/Filter/Spatial.js",
249                "OpenLayers/Filter/Function.js",                
250                "OpenLayers/Protocol.js",
251                "OpenLayers/Protocol/HTTP.js",
252                "OpenLayers/Protocol/SQL.js",
253                "OpenLayers/Protocol/SQL/Gears.js",
254                "OpenLayers/Protocol/WFS.js",
255                "OpenLayers/Protocol/WFS/v1.js",
256                "OpenLayers/Protocol/WFS/v1_0_0.js",
257                "OpenLayers/Protocol/WFS/v1_1_0.js",
258                "OpenLayers/Protocol/Script.js",
259                "OpenLayers/Protocol/SOS.js",
260                "OpenLayers/Protocol/SOS/v1_0_0.js",
261                "OpenLayers/Layer/PointTrack.js",
262                "OpenLayers/Layer/GML.js",
263                "OpenLayers/Style.js",
264                "OpenLayers/Style2.js",
265                "OpenLayers/StyleMap.js",
266                "OpenLayers/Rule.js",
267                "OpenLayers/Format.js",
268                "OpenLayers/Format/QueryStringFilter.js",
269                "OpenLayers/Format/XML.js",
270                "OpenLayers/Format/XML/VersionedOGC.js",
271                "OpenLayers/Format/Context.js",
272                "OpenLayers/Format/ArcXML.js",
273                "OpenLayers/Format/ArcXML/Features.js",
274                "OpenLayers/Format/GML.js",
275                "OpenLayers/Format/GML/Base.js",
276                "OpenLayers/Format/GML/v2.js",
277                "OpenLayers/Format/GML/v3.js",
278                "OpenLayers/Format/Atom.js",
279                "OpenLayers/Format/KML.js",
280                "OpenLayers/Format/GeoRSS.js",
281                "OpenLayers/Format/WFS.js",
282                "OpenLayers/Format/WFSCapabilities.js",
283                "OpenLayers/Format/WFSCapabilities/v1.js",
284                "OpenLayers/Format/WFSCapabilities/v1_0_0.js",
285                "OpenLayers/Format/WFSCapabilities/v1_1_0.js",
286                "OpenLayers/Format/WFSDescribeFeatureType.js",
287                "OpenLayers/Format/WMSDescribeLayer.js",
288                "OpenLayers/Format/WMSDescribeLayer/v1_1.js",
289                "OpenLayers/Format/WKT.js",
290                "OpenLayers/Format/CQL.js",
291                "OpenLayers/Format/OSM.js",
292                "OpenLayers/Format/GPX.js",
293                "OpenLayers/Format/Filter.js",
294                "OpenLayers/Format/Filter/v1.js",
295                "OpenLayers/Format/Filter/v1_0_0.js",
296                "OpenLayers/Format/Filter/v1_1_0.js",
297                "OpenLayers/Format/SLD.js",
298                "OpenLayers/Format/SLD/v1.js",
299                "OpenLayers/Format/SLD/v1_0_0.js",
300                "OpenLayers/Format/OWSCommon.js",
301                "OpenLayers/Format/OWSCommon/v1.js",
302                "OpenLayers/Format/OWSCommon/v1_0_0.js",
303                "OpenLayers/Format/OWSCommon/v1_1_0.js",
304                "OpenLayers/Format/CSWGetDomain.js",
305                "OpenLayers/Format/CSWGetDomain/v2_0_2.js",
306                "OpenLayers/Format/CSWGetRecords.js",
307                "OpenLayers/Format/CSWGetRecords/v2_0_2.js",
308                "OpenLayers/Format/WFST.js",
309                "OpenLayers/Format/WFST/v1.js",
310                "OpenLayers/Format/WFST/v1_0_0.js",
311                "OpenLayers/Format/WFST/v1_1_0.js",
312                "OpenLayers/Format/Text.js",
313                "OpenLayers/Format/JSON.js",
314                "OpenLayers/Format/GeoJSON.js",
315                "OpenLayers/Format/WMC.js",
316                "OpenLayers/Format/WMC/v1.js",
317                "OpenLayers/Format/WMC/v1_0_0.js",
318                "OpenLayers/Format/WMC/v1_1_0.js",
319                "OpenLayers/Format/WCSGetCoverage.js",
320                "OpenLayers/Format/WMSCapabilities.js",
321                "OpenLayers/Format/WMSCapabilities/v1.js",
322                "OpenLayers/Format/WMSCapabilities/v1_1.js",
323                "OpenLayers/Format/WMSCapabilities/v1_1_0.js",
324                "OpenLayers/Format/WMSCapabilities/v1_1_1.js",
325                "OpenLayers/Format/WMSCapabilities/v1_3.js",
326                "OpenLayers/Format/WMSCapabilities/v1_3_0.js",
327                "OpenLayers/Format/WMSCapabilities/v1_1_1_WMSC.js",
328                "OpenLayers/Format/WMSGetFeatureInfo.js",
329                "OpenLayers/Format/SOSCapabilities.js",
330                "OpenLayers/Format/SOSCapabilities/v1_0_0.js",
331                "OpenLayers/Format/SOSGetFeatureOfInterest.js",
332                "OpenLayers/Format/SOSGetObservation.js",
333                "OpenLayers/Format/OWSContext.js",
334                "OpenLayers/Format/OWSContext/v0_3_1.js",
335                "OpenLayers/Format/WMTSCapabilities.js",
336                "OpenLayers/Format/WMTSCapabilities/v1_0_0.js",
337                "OpenLayers/Format/WPSCapabilities.js",
338                "OpenLayers/Format/WPSCapabilities/v1_0_0.js",
339                "OpenLayers/Format/WPSDescribeProcess.js",
340                "OpenLayers/Format/WPSExecute.js",
341                "OpenLayers/Format/XLS.js",
342                "OpenLayers/Format/XLS/v1.js",
343                "OpenLayers/Format/XLS/v1_1_0.js",
344                "OpenLayers/Format/OGCExceptionReport.js",
345                "OpenLayers/Layer/WFS.js",
346                "OpenLayers/Control/GetFeature.js",
347                "OpenLayers/Control/MouseToolbar.js",
348                "OpenLayers/Control/NavToolbar.js",
349                "OpenLayers/Control/PanPanel.js",
350                "OpenLayers/Control/Pan.js",
351                "OpenLayers/Control/ZoomIn.js",
352                "OpenLayers/Control/ZoomOut.js",
353                "OpenLayers/Control/ZoomPanel.js",
354                "OpenLayers/Control/EditingToolbar.js",
355                "OpenLayers/Control/Geolocate.js",
356                "OpenLayers/Symbolizer.js",
357                "OpenLayers/Symbolizer/Point.js",
358                "OpenLayers/Symbolizer/Line.js",
359                "OpenLayers/Symbolizer/Polygon.js",
360                "OpenLayers/Symbolizer/Text.js",
361                "OpenLayers/Symbolizer/Raster.js",
362                "OpenLayers/Lang.js",
363                "OpenLayers/Lang/en.js"
364            ]; // etc.
365        }
366
367        // use "parser-inserted scripts" for guaranteed execution order
368        // http://hsivonen.iki.fi/script-execution/
369        var scriptTags = new Array(jsFiles.length);
370        var host = OpenLayers._getScriptLocation() + "lib/";
371        for (var i=0, len=jsFiles.length; i<len; i++) {
372            scriptTags[i] = "<script src='" + host + jsFiles[i] +
373                                   "'></script>"; 
374        }
375        if (scriptTags.length > 0) {
376            document.write(scriptTags.join(""));
377        }
378    }
379})();
380
381/**
382 * Constant: VERSION_NUMBER
383 */
384OpenLayers.VERSION_NUMBER="Release 2.11";
385
Full Screen

Accelerate Your Automation Test Cycles With LambdaTest

Leverage LambdaTest’s cloud-based platform to execute your automation tests in parallel and trim down your test execution time significantly. Your first 100 automation testing minutes are on us.

Try LambdaTest

Run JavaScript Tests on LambdaTest Cloud Grid

Execute automation tests with Cypress on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free
LambdaTestX

We use cookies to give you the best experience. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. Learn More in our Cookies policy, Privacy & Terms of service

Allow Cookie
Sarah

I hope you find the best code examples for your project.

If you want to accelerate automated browser testing, try LambdaTest. Your first 100 automation testing minutes are FREE.

Sarah Elson (Product & Growth Lead)