POST
|
this Code function Print() { debugger require(["esri/map", "esri/config", "esri/geometry/Extent", "esri/layers/ArcGISTiledMapServiceLayer", "esri/tasks/PrintTask", "esri/tasks/PrintTemplate", "esri/tasks/PrintParameters"], function (Map,esriConfig, Extent, ArcGISTiledMapServiceLayer, PrintTask, PrintTemplate, PrintParameters) { esriConfig.defaults.io.alwaysUseProxy = false; var template = new PrintTemplate(); template.exportOptions = { width: 500, height: 400, dpi: 96 }; template.format = "JPG"; template.layout = "MAP_ONLY"; template.preserveScale = false; var params = new PrintParameters(); params.map = layerMap; params.template = template; var printTask = new PrintTask("http://maps.decaturil.gov/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"); printTask.execute(params, function (imagePath) { window.open(imagePath.url); debugger; }, function (err) { console.log(err); }); }); } this method not run and idea
... View more
12-23-2015
04:01 AM
|
0
|
1
|
2409
|
POST
|
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ReadJosn.aspx.cs" Inherits="ReadJosn" %> <!doctype html> <html> <head> <title>...</title> <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.2/js/dojo/dijit/themes/claro/claro.css"> <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.2"></script> <script type="text/javascript" language="Javascript"> dojo.require("esri.map"); dojo.require("esri.layers.FeatureLayer"); dojo.require("esri.layers.graphics"); var map; function init() { //var startExtent = new esri.geometry.Extent({ "xmin": -12505511, "ymin": 2230016, "xmax": -3699965, "ymax": 8100380, "spatialReference": { "wkid": 102100 } }); map = new esri.Map("mapDiv"); //create and add new layer var layer = new esri.layers.ArcGISTiledMapServiceLayer(""); var sketchLayer = ""; map.addLayer(layer); var jsonFS = { "geometry": { "rings": [[[663791.8729519134, 2760558.7151297885], [663791.8729519134, 2760492.5691641634], [667099.1712331766, 2749776.9227328706], [656118.9409393826, 2749247.7550078686], [652547.0587956184, 2755994.6435016454], [663791.8729519134, 2760558.7151297885]]], "spatialReference": { "wkid": 32638, "latestWkid": 32638 } }, "symbol": { "color": [0, 0, 0, 64], "outline": { "color": [0, 0, 0, 255], "width": 1, "type": "esriSLS", "style": "esriSLSSolid" }, "type": "esriSFS", "style": "esriSFSSolid" } } ; // var temp = eval("(" + jsonFS + ")"); //var sk = new esri.Graphic(eval("(" + jsonFS + ")")); alert("0"); map.getLayer("sketchLayer").add(new esri.Graphic(eval("(" + jsonFS + ")"))); map.addLayer(new esri.Graphic(eval("(" + jsonFS + ")"))); alert("addLayer" + sk); //console.log(jsonFS.features); //var fs = new esri.tasks.FeatureSet(jsonFS); //var featureCollection = { // layerDefinition: { // "geometryType": "esriGeometryPoint", // "fields": [ // { // } // ] // }, // featureSet: fs //}; //var jsonfl = new esri.layers.FeatureLayer(featureCollection, { // mode: esri.layers.FeatureLayer.MODE_SNAPSHOT, // 'id': 'jsonfl' //}); //map.addLayer(jsonfl); } dojo.ready(init); </script> </head> <body class="claro"> <div id="mapDiv" style="width: 900px; height: 600px; border: 1px solid #000;"></div> </body> </html> no Graphic appear to map any idea ??? Help
... View more
08-02-2015
12:07 AM
|
0
|
0
|
184
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|