From 4acd128c26b547bc256c100a64867194d8ee5b0a Mon Sep 17 00:00:00 2001 From: AleksiKaa Date: Fri, 7 Jul 2023 14:26:44 +0300 Subject: [PATCH 1/7] make map iframe larger --- tests/rpc/SpecRunner.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/rpc/SpecRunner.html b/tests/rpc/SpecRunner.html index 3c7745873c..b7119c6f9d 100644 --- a/tests/rpc/SpecRunner.html +++ b/tests/rpc/SpecRunner.html @@ -19,7 +19,7 @@ - + From b6e58f11118e2d966457d3727f6e9060973079ea Mon Sep 17 00:00:00 2001 From: AleksiKaa Date: Fri, 7 Jul 2023 14:45:19 +0300 Subject: [PATCH 2/7] update tested values to current values --- tests/rpc/src/common_parameters.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/rpc/src/common_parameters.js b/tests/rpc/src/common_parameters.js index 064df2e203..560f9b9f80 100644 --- a/tests/rpc/src/common_parameters.js +++ b/tests/rpc/src/common_parameters.js @@ -23,10 +23,10 @@ var counter; // ##################### // var general = { - "ExpectedOskariVersion": "1.44.3", + "ExpectedOskariVersion": "2.11.0", "ExpectedRPCVersion": "2.0.4", "IsSupported": true, - "srsName": "EPSG:4326" + "srsName": "EPSG:3067" }; // ##################### // From b8167cf67fbdc5e9cd475cf7e6fbcc47787af0cc Mon Sep 17 00:00:00 2001 From: AleksiKaa Date: Wed, 12 Jul 2023 13:35:43 +0300 Subject: [PATCH 3/7] format file and update commands supported by oskari --- tests/rpc/src/common_parameters.js | 208 +++++++++++++++-------------- 1 file changed, 108 insertions(+), 100 deletions(-) diff --git a/tests/rpc/src/common_parameters.js b/tests/rpc/src/common_parameters.js index 560f9b9f80..f6f93fc8cd 100644 --- a/tests/rpc/src/common_parameters.js +++ b/tests/rpc/src/common_parameters.js @@ -9,8 +9,8 @@ var iFrameDomain = mapUrl.substring(0, mapUrl.indexOf('?')); // init connection var iFrame = document.getElementById('map'); window.channel = OskariRPC.connect( - iFrame, - iFrameDomain + iFrame, + iFrameDomain ); /* @@ -44,7 +44,7 @@ var defaultPosition = { var defaultLayer = { "Id": "base_35", "Opacity": 100, - "visible": true, + "visible": true , "name": "Taustakarttasarja", }; @@ -164,14 +164,14 @@ var featureStyle = { color: '#FF0000', width: 5 }, - text : { - scale : 2, - fill : { - color : 'rgba(0,0,0,1)' + text: { + scale: 2, + fill: { + color: 'rgba(0,0,0,1)' }, - stroke : { - color : 'rgba(255,255,255,0)', - width : 1 + stroke: { + color: 'rgba(255,255,255,0)', + width: 1 }, labelText: 'Test feature' } @@ -222,95 +222,95 @@ var markerInfobox = [ // ###################### // // # Show or hide info box -var myInfoBox =[ - "myInfoBox", - "Generic info box", - [ - { - "html": "
Map position info:
" - }, - { - "html": "
Center: "+defaultPosition.centerX+", "+defaultPosition.centerY+"
", - "actions": [ - { - "name": "My link 1", - "type": "link", - "action": { - "info": "this can include any info", - "info2": "action-object can have any number of params" - } - }, - { - "name": "My link 2", - "type": "link", - "action": { - "info": "this can include any info", - "info2": "action-object can have any number of params" - } - } - ] - }, +var myInfoBox = [ + "myInfoBox", + "Generic info box", + [ + { + "html": "
Map position info:
" + }, + { + "html": "
Center: " + defaultPosition.centerX + ", " + defaultPosition.centerY + "
", + "actions": [ { - "html": "
Zoom level: "+defaultPosition.zoom+"
" + "name": "My link 1", + "type": "link", + "action": { + "info": "this can include any info", + "info2": "action-object can have any number of params" + } }, { - "actions": [ - { - "name": "My link 3", - "type": "link", - "action": { - "info": "this can include any info", - "info2": "action-object can have any number of params" - } - }, - { - "name": "My link 4", - "type": "link", - "action": { - "info": "this can include any info", - "info2": "action-object can have any number of params" - } - }, - { - "name": "My button 1", - "type": "button", - "group": 1, - "action": { - "info": "this can include any info", - "info2": "action-object can have any number of params", - "buttonInfo": "This button has group 1 and is placed to the same row with other actions that have the same group" - } - }, - { - "name": "My button 2", - "type": "button", - "group": 1, - "action": { - "info": "this can include any info", - "info2": "action-object can have any number of params", - "buttonInfo": "This button has group 1 and is placed to the same row with other actions that have the same group" - } - } - ] + "name": "My link 2", + "type": "link", + "action": { + "info": "this can include any info", + "info2": "action-object can have any number of params" + } } - ], + ] + }, { - "lon": defaultPosition.centerX, - "lat": defaultPosition.centerY + "html": "
Zoom level: " + defaultPosition.zoom + "
" }, { - "colourScheme": { - "bgColour": "#00CCFF", - "titleColour": "#FFFFFF", - "headerColour": "#00CCFF", - "iconCls": "icon-close-white", - "buttonBgColour": "#00CCFF", - "buttonLabelColour": "#FFFFFF", - "linkColour": "#000000" + "actions": [ + { + "name": "My link 3", + "type": "link", + "action": { + "info": "this can include any info", + "info2": "action-object can have any number of params" + } + }, + { + "name": "My link 4", + "type": "link", + "action": { + "info": "this can include any info", + "info2": "action-object can have any number of params" + } }, - "font": "georgia", - "positioning": "left" + { + "name": "My button 1", + "type": "button", + "group": 1, + "action": { + "info": "this can include any info", + "info2": "action-object can have any number of params", + "buttonInfo": "This button has group 1 and is placed to the same row with other actions that have the same group" + } + }, + { + "name": "My button 2", + "type": "button", + "group": 1, + "action": { + "info": "this can include any info", + "info2": "action-object can have any number of params", + "buttonInfo": "This button has group 1 and is placed to the same row with other actions that have the same group" + } + } + ] } + ], + { + "lon": defaultPosition.centerX, + "lat": defaultPosition.centerY + }, + { + "colourScheme": { + "bgColour": "#00CCFF", + "titleColour": "#FFFFFF", + "headerColour": "#00CCFF", + "iconCls": "icon-close-white", + "buttonBgColour": "#00CCFF", + "buttonLabelColour": "#FFFFFF", + "linkColour": "#000000" + }, + "font": "georgia", + "positioning": "left" + } ]; var infoboxId = 'myInfoBox'; @@ -356,7 +356,9 @@ var supportedEvents = [ "InfoBox.InfoBoxEvent", "RPCUIEvent", "map.rotated", - "DataForMapLocationEvent" + "MapTourEvent", + "DataForMapLocationEvent", + "StateChangedEvent" ]; var supportedFunctions = [ @@ -364,27 +366,29 @@ var supportedFunctions = [ "getSupportedFunctions", "getSupportedRequests", "getInfo", + "resetState", + "getCurrentState", + "useState", + "sendUIEvent", "getAllLayers", - "getMapBbox", - "getMapPosition", "getZoomRange", "zoomIn", "zoomOut", "zoomTo", "getPixelMeasuresInScale", - "resetState", - "getCurrentState", - "useState", - "getFeatures", + "getMapBbox", + "getMapPosition", "setCursorStyle", - "sendUIEvent", - "getScreenshot" + "getVectorFeatures", + "getScreenshot", + "getFeatures" ]; var supportedRequests = [ "InfoBox.ShowInfoBoxRequest", "InfoBox.HideInfoBoxRequest", "MapModulePlugin.AddMarkerRequest", + "VectorLayerRequest", "MapModulePlugin.AddFeaturesToMapRequest", "MapModulePlugin.RemoveFeaturesFromMapRequest", "MapModulePlugin.GetFeatureInfoRequest", @@ -392,12 +396,13 @@ var supportedRequests = [ "MapModulePlugin.RemoveMarkersRequest", "MapModulePlugin.MarkerVisibilityRequest", "MapMoveRequest", + "MapTourRequest", "ShowProgressSpinnerRequest", + "SetTimeRequest", "GetRouteRequest", "GetFeedbackServiceRequest", "GetFeedbackRequest", "PostFeedbackRequest", - "rotate.map", "SearchRequest", "ChangeMapLayerOpacityRequest", "MyLocationPlugin.GetUserLocationRequest", @@ -405,6 +410,9 @@ var supportedRequests = [ "DrawTools.StopDrawingRequest", "MapModulePlugin.ZoomToFeaturesRequest", "MapModulePlugin.MapLayerUpdateRequest", + "rotate.map", + "StartUserLocationTrackingRequest", + "StopUserLocationTrackingRequest", "ChangeMapLayerStyleRequest", "RearrangeSelectedMapLayerRequest" ]; From 2bfb815215842cb85bcfad29d1f93f9088c50538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksi=20K=C3=A4=C3=A4ri=C3=A4inen?= Date: Fri, 14 Jul 2023 14:09:42 +0300 Subject: [PATCH 4/7] update readme --- tests/rpc/README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/rpc/README.md b/tests/rpc/README.md index 8c71de9395..1f9e8e3790 100644 --- a/tests/rpc/README.md +++ b/tests/rpc/README.md @@ -8,45 +8,45 @@ JasmineJS test suite for testing Oskari rpc functions, events and requests. To run tests on your published map set the URL in common_parts.js. -``` -mapURL = 'http://demo.oskari.org/?lang=en&uuid=8016f9be-131b-44ab-bcee-5055628dbd42' +``` javascript +var mapURL = 'http://demo.oskari.org/?lang=en&uuid=8016f9be-131b-44ab-bcee-5055628dbd42' ``` ### Adding tests Add specs to SpecRunner.html -``` +``` html ``` ## Running the tests -SpecRunner.html runs the defined specs. Open it from server (for example http://localhost:8080/Oskari/tests/rpc/SpecRunner.html). +SpecRunner.html runs the defined specs. Open it from server (for example [http://localhost:8080/Oskari/tests/rpc/SpecRunner.html](http://localhost:8080/Oskari/tests/rpc/SpecRunner.html)). ### All tests To run all tests open SpecRunner.html in browser. -``` -SpecRunner.html +``` bash +/SpecRunner.html ``` ### Specific spec Run tests from one spec by specifying the name in the URL or by clicking the spec name in browser. -``` -SpecRunner.html?spec=Map +``` bash +/SpecRunner.html?spec=Map ``` ### Specific test Run only one test by specifying the test name in URL or by clicking the test name in browser. -``` -SpecRunner.html?spec=Map%20Zoom%20functions%20Gets%20Zoom%20Range +``` bash +/SpecRunner.html?spec=Map%20Zoom%20functions%20Gets%20Zoom%20Range ``` ## Framework @@ -55,11 +55,11 @@ SpecRunner.html?spec=Map%20Zoom%20functions%20Gets%20Zoom%20Range ## RPC documentation -* http://www.oskari.org/examples/rpc-api/rpc_example.html -* http://www.oskari.org/documentation/bundles/framework/rpc -* http://www.oskari.org/api/bundles -* http://www.oskari.org/api/requests -* http://www.oskari.org/api/events +* [RPC example](http://www.oskari.org/examples/rpc-api/rpc_example.html) +* [RPC documentation](https://www.oskari.org/api/bundles#/unreleased/framework/rpc) +* [Bundles](http://www.oskari.org/api/bundles) +* [RPC Requests](http://www.oskari.org/api/requests) +* [RPC Events](http://www.oskari.org/api/events) ## License From f3ef12d445d27268fcdbabc4733d6b2b124a7f99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksi=20K=C3=A4=C3=A4ri=C3=A4inen?= Date: Fri, 14 Jul 2023 14:13:44 +0300 Subject: [PATCH 5/7] create parameter file for paikkatietoikkuna map --- tests/rpc/SpecRunner.html | 2 +- tests/rpc/src/paikkatietoikkuna_parameters.js | 418 ++++++++++++++++++ 2 files changed, 419 insertions(+), 1 deletion(-) create mode 100644 tests/rpc/src/paikkatietoikkuna_parameters.js diff --git a/tests/rpc/SpecRunner.html b/tests/rpc/SpecRunner.html index b7119c6f9d..bebf4c7d92 100644 --- a/tests/rpc/SpecRunner.html +++ b/tests/rpc/SpecRunner.html @@ -22,7 +22,7 @@ - + diff --git a/tests/rpc/src/paikkatietoikkuna_parameters.js b/tests/rpc/src/paikkatietoikkuna_parameters.js new file mode 100644 index 0000000000..f6f93fc8cd --- /dev/null +++ b/tests/rpc/src/paikkatietoikkuna_parameters.js @@ -0,0 +1,418 @@ +/* +Switch map URL to test other maps +*/ +var mapUrl = 'https://kartta.paikkatietoikkuna.fi/?lang=en&uuid=053027f4-91d9-4351-aec4-c6a31dd68c56'; +// sets source +document.getElementById('map').src = mapUrl; +// sets domain (localhost is allowed) +var iFrameDomain = mapUrl.substring(0, mapUrl.indexOf('?')); +// init connection +var iFrame = document.getElementById('map'); +window.channel = OskariRPC.connect( + iFrame, + iFrameDomain +); + +/* +Test parameters for specs +*/ +var counter; + +// ##################### // +// ##### General ##### // +// ##################### // + +var general = { + "ExpectedOskariVersion": "2.11.0", + "ExpectedRPCVersion": "2.0.4", + "IsSupported": true, + "srsName": "EPSG:3067" +}; + +// ##################### // +// ##### Map ##### // +// ##################### // + +var defaultPosition = { + "centerX": 386020, + "centerY": 6670057, + "zoom": 0, + "scale": 5805343, + "srsName": "EPSG:3067" +}; + +var defaultLayer = { + "Id": "base_35", + "Opacity": 100, + "visible": true , + "name": "Taustakarttasarja", +}; + +// ##################### // +// ##### Features ##### // +// ##################### // + +var pointGeojsonObject = { + 'type': 'FeatureCollection', + 'crs': { + 'type': 'name', + 'properties': { + 'name': defaultPosition.srsName + } + }, + 'features': [{ + 'type': 'Feature', + 'geometry': { + 'type': 'Point', + 'coordinates': [defaultPosition.centerX, defaultPosition.centerY] + }, + 'properties': { + 'label': 'I am a point feature!', + 'test_property': "point feature" + } + }] +}; + +var addPointFeatureParams = [pointGeojsonObject, { + layerId: 'VECTOR', + clearPrevious: false, + centerTo: true, + cursor: 'zoom-in', + featureStyle: { + image: { + shape: 4, + size: 5, + color: '#ff3300', + stroke: '#000000' + }, + text: { + scale: 1.3, + fill: { + color: 'rgba(0,0,0,1)' + }, + stroke: { + color: 'rgba(255,255,255,1)', + width: 2 + }, + labelProperty: 'label', + offsetX: 65, + offsetY: 8 + } + } +}]; + +var lineGeojsonObject = { + 'type': 'FeatureCollection', + 'crs': { + 'type': 'name', + 'properties': { + 'name': defaultPosition.srsName + } + }, + 'features': [{ + 'type': 'Feature', + 'geometry': { + 'type': 'LineString', + 'coordinates': [ + [defaultPosition.centerX, defaultPosition.centerY], + [defaultPosition.centerX + 100000, defaultPosition.centerY + 1100000] + ] + }, + 'properties': { + 'label': "I am a line feature!", + 'test_property': "line feature" + } + }] +}; + +var addLineFeatureParams = [lineGeojsonObject, { + layerId: 'VECTOR', + clearPrevious: true, + layerOptions: testLayerOptions, + centerTo: true, + cursor: 'zoom-in', + featureStyle: { + fill: { + color: '#2200ff' + }, + stroke: { + color: '#2200ff', + width: 3 + }, + text: { + scale: 2.0, + fill: { + color: 'rgba(2,2,0,1)' + }, + stroke: { + color: 'rgba(0,255,1,1)', + width: 0 + }, + labelProperty: 'label' + } + }, + prio: 4, + //minScale: 1451336 +}]; + +// Styling for object +var featureStyle = { + fill: { + color: 'rgba(0,0,0,0.3)', + }, + stroke: { + color: '#FF0000', + width: 5 + }, + text: { + scale: 2, + fill: { + color: 'rgba(0,0,0,1)' + }, + stroke: { + color: 'rgba(255,255,255,0)', + width: 1 + }, + labelText: 'Test feature' + } +}; + +var testLayerOptions = { + 'minResolution': 0, + 'maxResolution': 10000 +}; + +// ###################### // +// ###### Markers ###### // +// ###################### // + +var MARKER_ID = "TEST_MARKER"; + +var testMarker = { + x: 0, + y: 0, + color: "ff0000", + msg: 'This is shape #2', + shape: 2, // icon number (0-6) + size: 12 +}; + +var markerShapeSvg = ''; +var markerShapeLink = 'http://oskari.org/logo.png'; + +var infoboxContent = [{ + 'html': 'Test Marker Popup Content' +}]; + +var markerInfobox = [ + 'TEST_MARKER', + 'Marker info box header', + infoboxContent, { + marker: MARKER_ID + }, { + mobileBreakpoints: { + width: 0, + height: 0 + }, + hidePrevious: true + } +]; +// ###################### // +// ###### UI ###### // +// ###################### // + +// # Show or hide info box +var myInfoBox = [ + "myInfoBox", + "Generic info box", + [ + { + "html": "
Map position info:
" + }, + { + "html": "
Center: " + defaultPosition.centerX + ", " + defaultPosition.centerY + "
", + "actions": [ + { + "name": "My link 1", + "type": "link", + "action": { + "info": "this can include any info", + "info2": "action-object can have any number of params" + } + }, + { + "name": "My link 2", + "type": "link", + "action": { + "info": "this can include any info", + "info2": "action-object can have any number of params" + } + } + ] + }, + { + "html": "
Zoom level: " + defaultPosition.zoom + "
" + }, + { + "actions": [ + { + "name": "My link 3", + "type": "link", + "action": { + "info": "this can include any info", + "info2": "action-object can have any number of params" + } + }, + { + "name": "My link 4", + "type": "link", + "action": { + "info": "this can include any info", + "info2": "action-object can have any number of params" + } + }, + { + "name": "My button 1", + "type": "button", + "group": 1, + "action": { + "info": "this can include any info", + "info2": "action-object can have any number of params", + "buttonInfo": "This button has group 1 and is placed to the same row with other actions that have the same group" + } + }, + { + "name": "My button 2", + "type": "button", + "group": 1, + "action": { + "info": "this can include any info", + "info2": "action-object can have any number of params", + "buttonInfo": "This button has group 1 and is placed to the same row with other actions that have the same group" + } + } + ] + } + ], + { + "lon": defaultPosition.centerX, + "lat": defaultPosition.centerY + }, + { + "colourScheme": { + "bgColour": "#00CCFF", + "titleColour": "#FFFFFF", + "headerColour": "#00CCFF", + "iconCls": "icon-close-white", + "buttonBgColour": "#00CCFF", + "buttonLabelColour": "#FFFFFF", + "linkColour": "#000000" + }, + "font": "georgia", + "positioning": "left" + } +]; + +var infoboxId = 'myInfoBox'; + +// # Send UI event +var UIEvents = [ + 'coordinatetool', + 'mapmodule.crosshair' +]; + +// # Set cursor style +var cursorStyles = [ + "progress", + "crosshair", + "move", + "pointer", + "default" +]; + +// ##################### // +// ##### Location ##### // +// ##################### // + +var searchCriteria = "Helsinki"; + + +// ##################### // +// ##### Supported ##### // +// ##################### // + +var supportedEvents = [ + "AfterMapMoveEvent", + "MapClickedEvent", + "AfterAddMarkerEvent", + "MarkerClickEvent", + "RouteResultEvent", + "FeedbackResultEvent", + "SearchResultEvent", + "UserLocationEvent", + "DrawingEvent", + "FeatureEvent", + "InfoboxActionEvent", + "InfoBox.InfoBoxEvent", + "RPCUIEvent", + "map.rotated", + "MapTourEvent", + "DataForMapLocationEvent", + "StateChangedEvent" +]; + +var supportedFunctions = [ + "getSupportedEvents", + "getSupportedFunctions", + "getSupportedRequests", + "getInfo", + "resetState", + "getCurrentState", + "useState", + "sendUIEvent", + "getAllLayers", + "getZoomRange", + "zoomIn", + "zoomOut", + "zoomTo", + "getPixelMeasuresInScale", + "getMapBbox", + "getMapPosition", + "setCursorStyle", + "getVectorFeatures", + "getScreenshot", + "getFeatures" +]; + +var supportedRequests = [ + "InfoBox.ShowInfoBoxRequest", + "InfoBox.HideInfoBoxRequest", + "MapModulePlugin.AddMarkerRequest", + "VectorLayerRequest", + "MapModulePlugin.AddFeaturesToMapRequest", + "MapModulePlugin.RemoveFeaturesFromMapRequest", + "MapModulePlugin.GetFeatureInfoRequest", + "MapModulePlugin.MapLayerVisibilityRequest", + "MapModulePlugin.RemoveMarkersRequest", + "MapModulePlugin.MarkerVisibilityRequest", + "MapMoveRequest", + "MapTourRequest", + "ShowProgressSpinnerRequest", + "SetTimeRequest", + "GetRouteRequest", + "GetFeedbackServiceRequest", + "GetFeedbackRequest", + "PostFeedbackRequest", + "SearchRequest", + "ChangeMapLayerOpacityRequest", + "MyLocationPlugin.GetUserLocationRequest", + "DrawTools.StartDrawingRequest", + "DrawTools.StopDrawingRequest", + "MapModulePlugin.ZoomToFeaturesRequest", + "MapModulePlugin.MapLayerUpdateRequest", + "rotate.map", + "StartUserLocationTrackingRequest", + "StopUserLocationTrackingRequest", + "ChangeMapLayerStyleRequest", + "RearrangeSelectedMapLayerRequest" +]; From 2f6cd36cd1d52bfbf2f084e2ae1aeed2838bc21b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksi=20K=C3=A4=C3=A4ri=C3=A4inen?= Date: Fri, 14 Jul 2023 14:16:22 +0300 Subject: [PATCH 6/7] revert changes made to common_parameters since now using own parameter files per published map --- tests/rpc/src/common_parameters.js | 215 ++++++++++++++--------------- 1 file changed, 104 insertions(+), 111 deletions(-) diff --git a/tests/rpc/src/common_parameters.js b/tests/rpc/src/common_parameters.js index f6f93fc8cd..91b4aa5112 100644 --- a/tests/rpc/src/common_parameters.js +++ b/tests/rpc/src/common_parameters.js @@ -1,7 +1,8 @@ /* Switch map URL to test other maps */ -var mapUrl = 'https://kartta.paikkatietoikkuna.fi/?lang=en&uuid=053027f4-91d9-4351-aec4-c6a31dd68c56'; +var mapUrl = 'http://demo.oskari.org/?lang=en&uuid=8016f9be-131b-44ab-bcee-5055628dbd42'; + // sets source document.getElementById('map').src = mapUrl; // sets domain (localhost is allowed) @@ -9,8 +10,8 @@ var iFrameDomain = mapUrl.substring(0, mapUrl.indexOf('?')); // init connection var iFrame = document.getElementById('map'); window.channel = OskariRPC.connect( - iFrame, - iFrameDomain + iFrame, + iFrameDomain ); /* @@ -23,10 +24,10 @@ var counter; // ##################### // var general = { - "ExpectedOskariVersion": "2.11.0", + "ExpectedOskariVersion": "1.44.3", "ExpectedRPCVersion": "2.0.4", "IsSupported": true, - "srsName": "EPSG:3067" + "srsName": "EPSG:4326" }; // ##################### // @@ -44,7 +45,7 @@ var defaultPosition = { var defaultLayer = { "Id": "base_35", "Opacity": 100, - "visible": true , + "visible": true, "name": "Taustakarttasarja", }; @@ -164,14 +165,14 @@ var featureStyle = { color: '#FF0000', width: 5 }, - text: { - scale: 2, - fill: { - color: 'rgba(0,0,0,1)' + text : { + scale : 2, + fill : { + color : 'rgba(0,0,0,1)' }, - stroke: { - color: 'rgba(255,255,255,0)', - width: 1 + stroke : { + color : 'rgba(255,255,255,0)', + width : 1 }, labelText: 'Test feature' } @@ -222,95 +223,95 @@ var markerInfobox = [ // ###################### // // # Show or hide info box -var myInfoBox = [ - "myInfoBox", - "Generic info box", - [ - { - "html": "
Map position info:
" - }, - { - "html": "
Center: " + defaultPosition.centerX + ", " + defaultPosition.centerY + "
", - "actions": [ +var myInfoBox =[ + "myInfoBox", + "Generic info box", + [ { - "name": "My link 1", - "type": "link", - "action": { - "info": "this can include any info", - "info2": "action-object can have any number of params" - } + "html": "
Map position info:
" }, { - "name": "My link 2", - "type": "link", - "action": { - "info": "this can include any info", - "info2": "action-object can have any number of params" - } - } - ] - }, - { - "html": "
Zoom level: " + defaultPosition.zoom + "
" - }, - { - "actions": [ - { - "name": "My link 3", - "type": "link", - "action": { - "info": "this can include any info", - "info2": "action-object can have any number of params" - } + "html": "
Center: "+defaultPosition.centerX+", "+defaultPosition.centerY+"
", + "actions": [ + { + "name": "My link 1", + "type": "link", + "action": { + "info": "this can include any info", + "info2": "action-object can have any number of params" + } + }, + { + "name": "My link 2", + "type": "link", + "action": { + "info": "this can include any info", + "info2": "action-object can have any number of params" + } + } + ] }, { - "name": "My link 4", - "type": "link", - "action": { - "info": "this can include any info", - "info2": "action-object can have any number of params" - } + "html": "
Zoom level: "+defaultPosition.zoom+"
" }, { - "name": "My button 1", - "type": "button", - "group": 1, - "action": { - "info": "this can include any info", - "info2": "action-object can have any number of params", - "buttonInfo": "This button has group 1 and is placed to the same row with other actions that have the same group" - } - }, - { - "name": "My button 2", - "type": "button", - "group": 1, - "action": { - "info": "this can include any info", - "info2": "action-object can have any number of params", - "buttonInfo": "This button has group 1 and is placed to the same row with other actions that have the same group" - } + "actions": [ + { + "name": "My link 3", + "type": "link", + "action": { + "info": "this can include any info", + "info2": "action-object can have any number of params" + } + }, + { + "name": "My link 4", + "type": "link", + "action": { + "info": "this can include any info", + "info2": "action-object can have any number of params" + } + }, + { + "name": "My button 1", + "type": "button", + "group": 1, + "action": { + "info": "this can include any info", + "info2": "action-object can have any number of params", + "buttonInfo": "This button has group 1 and is placed to the same row with other actions that have the same group" + } + }, + { + "name": "My button 2", + "type": "button", + "group": 1, + "action": { + "info": "this can include any info", + "info2": "action-object can have any number of params", + "buttonInfo": "This button has group 1 and is placed to the same row with other actions that have the same group" + } + } + ] } - ] - } - ], - { - "lon": defaultPosition.centerX, - "lat": defaultPosition.centerY - }, - { - "colourScheme": { - "bgColour": "#00CCFF", - "titleColour": "#FFFFFF", - "headerColour": "#00CCFF", - "iconCls": "icon-close-white", - "buttonBgColour": "#00CCFF", - "buttonLabelColour": "#FFFFFF", - "linkColour": "#000000" + ], + { + "lon": defaultPosition.centerX, + "lat": defaultPosition.centerY }, - "font": "georgia", - "positioning": "left" - } + { + "colourScheme": { + "bgColour": "#00CCFF", + "titleColour": "#FFFFFF", + "headerColour": "#00CCFF", + "iconCls": "icon-close-white", + "buttonBgColour": "#00CCFF", + "buttonLabelColour": "#FFFFFF", + "linkColour": "#000000" + }, + "font": "georgia", + "positioning": "left" + } ]; var infoboxId = 'myInfoBox'; @@ -356,9 +357,7 @@ var supportedEvents = [ "InfoBox.InfoBoxEvent", "RPCUIEvent", "map.rotated", - "MapTourEvent", - "DataForMapLocationEvent", - "StateChangedEvent" + "DataForMapLocationEvent" ]; var supportedFunctions = [ @@ -366,29 +365,27 @@ var supportedFunctions = [ "getSupportedFunctions", "getSupportedRequests", "getInfo", - "resetState", - "getCurrentState", - "useState", - "sendUIEvent", "getAllLayers", + "getMapBbox", + "getMapPosition", "getZoomRange", "zoomIn", "zoomOut", "zoomTo", "getPixelMeasuresInScale", - "getMapBbox", - "getMapPosition", + "resetState", + "getCurrentState", + "useState", + "getFeatures", "setCursorStyle", - "getVectorFeatures", - "getScreenshot", - "getFeatures" + "sendUIEvent", + "getScreenshot" ]; var supportedRequests = [ "InfoBox.ShowInfoBoxRequest", "InfoBox.HideInfoBoxRequest", "MapModulePlugin.AddMarkerRequest", - "VectorLayerRequest", "MapModulePlugin.AddFeaturesToMapRequest", "MapModulePlugin.RemoveFeaturesFromMapRequest", "MapModulePlugin.GetFeatureInfoRequest", @@ -396,13 +393,12 @@ var supportedRequests = [ "MapModulePlugin.RemoveMarkersRequest", "MapModulePlugin.MarkerVisibilityRequest", "MapMoveRequest", - "MapTourRequest", "ShowProgressSpinnerRequest", - "SetTimeRequest", "GetRouteRequest", "GetFeedbackServiceRequest", "GetFeedbackRequest", "PostFeedbackRequest", + "rotate.map", "SearchRequest", "ChangeMapLayerOpacityRequest", "MyLocationPlugin.GetUserLocationRequest", @@ -410,9 +406,6 @@ var supportedRequests = [ "DrawTools.StopDrawingRequest", "MapModulePlugin.ZoomToFeaturesRequest", "MapModulePlugin.MapLayerUpdateRequest", - "rotate.map", - "StartUserLocationTrackingRequest", - "StopUserLocationTrackingRequest", "ChangeMapLayerStyleRequest", "RearrangeSelectedMapLayerRequest" ]; From f30eb32620f6b27e3b9f480a69099b0f7605d3b5 Mon Sep 17 00:00:00 2001 From: AleksiKaa <100208253+AleksiKaa@users.noreply.github.com> Date: Tue, 8 Aug 2023 15:33:03 +0300 Subject: [PATCH 7/7] Update tests/rpc/src/common_parameters.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sami Mäkinen --- tests/rpc/src/common_parameters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/rpc/src/common_parameters.js b/tests/rpc/src/common_parameters.js index 91b4aa5112..b597a65d14 100644 --- a/tests/rpc/src/common_parameters.js +++ b/tests/rpc/src/common_parameters.js @@ -1,7 +1,7 @@ /* Switch map URL to test other maps */ -var mapUrl = 'http://demo.oskari.org/?lang=en&uuid=8016f9be-131b-44ab-bcee-5055628dbd42'; +var mapUrl = 'https://demo.oskari.org/example'; // sets source document.getElementById('map').src = mapUrl;