hi
every body
i want example that add shape file to the map
but all element on page must be created programmatically with dojo
i try this:
_addShapeFile: function (tool, toolbar, panelClass) {
var ShapeFileDiv = toolbar.createTool(tool, panelClass);
domStyle.set(ShapeFileDiv, {
"height": "100%",
"width": "100%"
});
//var newDiv1 = document.createElement("div");
//document.getElementById("newDiv1").appendChild(ShapeFileDiv);
////newDiv1.appendChild(ShapeFileDiv);
var file = document.createElement("INPUT");
file.setAttribute("type", "file");
var uploadForm = dojo.place("<form> Add shapefile as .zip file </form>", ShapeFileDiv);
domConstruct.place(file, uploadForm);
var ShapeFilebutton = domConstruct.create("button", {
innerHTML: "Add FIle ",
className: "button",
type: "button",
style: { color: "red" }
}, domConstruct.create("div", {
"class": "button11"
}));this code create button and upload file on form but i could not add the uploaded file to the map
any help please
Solved! Go to Solution.
Yousof,
Then you need to look at JS Shapefile library like this one:
Yousof,
See this sample: Add shapefile | ArcGIS API for JavaScript
thank you for replying but this sample create all element in html where i want it programmatically
thank you