I want to try your code. Can you tell me how to integrate it into Cesium?
Should I just put the WebFeatureServiceImageryProvider.js file somewhere in source code folders? I've put it in Source/Scene and wrote code for initialization in sandcastle, but an error occurs
//initialise cesium
var viewer = new Cesium.Viewer("cesiumContainer");
//initialise WFS provider
var wfs = new Cesium.WebFeatureServiceImageryProvider({
url : "http://localhost:8080/geoserver/xxxxxx",
layers : "xxxxxx",
viewer : viewer
});
Uncaught TypeError: Cesium.WebFeatureServiceImageryProvider is not a constructor (on line 5)
--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/Jkga8_8tPWA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
thank you for quick answer and help, but I still don't manage to make the plugin work. I'm not very experienced in programming and I don't understand what do you mean by including the plugin in main html page in a script tags. I see there are Cesium.js and main.js files in Source folder but there's no main.html file. I've included the WebFeatureServiceImageryProvider in Cesium.js that looks like this:
define(['./Core/appendForwardSlash', './Core/arrayFill', *...LOTS OF SIMILAR CODE...*
, './Scene/WebFeatureServiceImageryProvider', *LOTS OF SIMILAR CODE*
Scene_WebFeatureServiceImageryProvider, *LOTS OF SIMILAR CODE*
Cesium['WebFeatureServiceImageryProvider'] = Scene_WebFeatureServiceImageryProvider; *LOTS OF SIMILAR CODE*
I haven't changed anything in sandcastle code except the url. Do I have to put something there?
Thank you again and best regards,
Paula
I've followed your advice, but still getting "Uncaught TypeError: Cesium.WebFeatureServiceImageryProvider is not a constructor (on line 4)".
Do you have any idea why is that so and how can I fix that?
Do I have to put WFS.js in a particular folder or it doesn't matter where I put it (like can I put it for example on Desktop)?
Also, you mentioned Cesium.js script tag but in examples from sandcastle there is only Sandcastle-header.js script tag like in the code below.
Thank you so much and sorry for bothering you,
Paula
--------------------------------------
This is how my html looks:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta name="description" content="Use Viewer to start building new applications or easily embed Cesium into existing applications.">
<meta name="cesium-sandcastle-labels" content="Beginner, Showcases">
<title>Cesium Demo</title>
<script type="text/javascript" src="../Sandcastle-header.js"></script>
<script type="text/javascript" src="C:/Program Files/Cesium-1.39/Source/WFS.js"></script>
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script>
<script type="text/javascript">
require.config({
baseUrl : '../../../Source',
waitSeconds : 60
});
</script>
</head>
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html">
<style>
@import url(../templates/bucket.css);
</style>
<div id="cesiumContainer" class="fullSize"></div>
<div id="loadingOverlay"><h1>Loading...</h1></div>
<div id="toolbar"></div>
<script id="cesium_sandcastle_script">
function startup(Cesium) {
'use strict';
//Sandcastle_Begin
var viewer = new Cesium.Viewer('cesiumContainer');
//initialise WFS provider
var wfs = new Cesium.WebFeatureServiceImageryProvider({
url : "http://localhost:8081/geoserver/web",
layers : "myLayer",
viewer : viewer
});
//Sandcastle_End
Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
startup(Cesium);
} else if (typeof require === "function") {
require(["Cesium"], startup);
}
</script>
</body>
</html>