| | 52 | function test_05_Control_Permalink_base_with_query (t) { |
|---|
| | 53 | t.plan( 3 ); |
|---|
| | 54 | |
|---|
| | 55 | control = new OpenLayers.Control.Permalink('permalink', "./edit.html?foo=bar" ); |
|---|
| | 56 | map = new OpenLayers.Map('map'); |
|---|
| | 57 | layer = new OpenLayers.Layer.WMS('Test Layer', "http://example.com" ); |
|---|
| | 58 | map.addLayer(layer); |
|---|
| | 59 | if (!map.getCenter()) map.zoomToMaxExtent(); |
|---|
| | 60 | map.addControl(control); |
|---|
| | 61 | map.pan(5, 0); |
|---|
| | 62 | OpenLayers.Util.getElement('edit_permalink').href = './edit.html?foo=bar&lat=0&lon=1.75781&zoom=2&layers=B'; |
|---|
| | 63 | t.eq(OpenLayers.Util.getElement('permalink').href, OpenLayers.Util.getElement('edit_permalink').href, "Panning sets permalink with base and querystring"); |
|---|
| | 64 | |
|---|
| | 65 | control = new OpenLayers.Control.Permalink('permalink', "./edit.html?foo=bar&" ); |
|---|
| | 66 | map.addControl(control); |
|---|
| | 67 | map.pan(0, 0); |
|---|
| | 68 | t.eq(OpenLayers.Util.getElement('permalink').href, OpenLayers.Util.getElement('edit_permalink').href, "Panning sets permalink with base and querystring ending with '&'"); |
|---|
| | 69 | |
|---|
| | 70 | control = new OpenLayers.Control.Permalink('permalink', "./edit.html?" ); |
|---|
| | 71 | OpenLayers.Util.getElement('edit_permalink').href = './edit.html?lat=0&lon=1.75781&zoom=2&layers=B'; |
|---|
| | 72 | map.addControl(control); |
|---|
| | 73 | map.pan(5, 0); |
|---|
| | 74 | map.pan(-5, 0); |
|---|
| | 75 | t.eq(OpenLayers.Util.getElement('permalink').href, OpenLayers.Util.getElement('edit_permalink').href, "Panning sets permalink with base and querystring ending with '?'"); |
|---|
| | 76 | |
|---|
| | 77 | } |
|---|