POST
|
Thanks! I have it working... except it prints the custom elements once. If I print again or click on the Map Only tab and click back, they do not show up on the print. Your thoughts?
... View more
12-05-2019
06:35 AM
|
0
|
1
|
694
|
POST
|
I have Custom Text Elements in my print template that works great when using WAB. The Custom fields show up when you click the print widget and gives you a chance to fill them out and it prints out correctly. When I click the print widget using JavaScript 4.13 it doesn't show the text boxes to fill out. Should it? If not, how do I go about making this happen? Is there an an example that I could use? Thanks! JavaScript snapshot: WAB snapshot: Here is my code that I'm using for the print widget: var print = new Print({ container: document.createElement("div"), view: view, printServiceUrl: "https://gisportal.abc.com/server/rest/services/PrintService/GPServer/Export%20Web%20Map", templateOptions: { title: "Corporation", author: "Joe", format:"pdf", layout: "1. 8.5x11 Portrait", copyright: "", legendEnabled: true, dpi: 300, customTextElements: [ {"Text1": ""}, {"Text2": ""}, {"Text3": ""}, {"Text4": ""}, {"Text5": ""}, {"Text6": ""}, {"Text7": ""}, {"Text8": ""} ] } })
... View more
11-26-2019
05:37 AM
|
0
|
3
|
798
|
POST
|
Custom Text Elements are not showing up in my templates that I created using ArcGIS Pro 2.4.1. I have the correct print service selected in the WAB application. The templates themselves show up when I go to print. The custom elements do not show up in the advanced button like they did in v10.6.1. We are now using 10.7.1 portal. When I go to the rest/services the templates show up there as well. Is there something I'm missing while creating the templates? Thanks in advance.
... View more
11-14-2019
12:39 PM
|
0
|
0
|
346
|
POST
|
Perfect! I just changed it to x,y min and x,y max. I do wish there was a way to mask everything outside the view extents. Thanks for the quick reply.
... View more
02-27-2019
08:24 AM
|
0
|
0
|
1519
|
POST
|
I found some javascript api 3.5 code on the internet that I have been trying to convert to 4.10 without success. I do admit that I am fairly new to the api and don't know if it is doable in 4.10. I'm trying to restrict users from panning and zooming outside the extents of the map area that I assign to them. Here is a working version I found using 3.5: http://jsfiddle.net/gh/gist/library/pure/6050806/ Thanks! <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=7, IE=9, IE=10"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/> <title>Simple Map</title> <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/dojo/dijit/themes/claro/claro.css"> <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/esri/css/esri.css"> <style> html, body, #map { height:100%; width:100%; margin:0; padding:0; } body { background-color:#FFF; overflow:hidden; font-family:"Trebuchet MS"; } </style> <script src="http://serverapi.arcgisonline.com/jsapi/arcgis/3.5/"></script> <script> dojo.require("esri.map"); var map = null; var extent = null; var maxExtent = null; function init() { map = new esri.Map("map",{ basemap:"topo", center:[-122.45,37.75], //long, lat zoom:13, sliderStyle:"small" }); //set max extent to inital extent dojo.connect(map, "onLoad", function(){ maxExtent = map.extent; }); //check to see if map is within max extent when its extent changes. If not, roll back to the max //extent that we set above dojo.connect(map, "onExtentChange", function(extent){ if((map.extent.xmin < maxExtent.xmin) || (map.extent.ymin < maxExtent.ymin) || (map.extent.xmax > maxExtent.xmax) || (map.extent.ymax > maxExtent.ymax) ) { map.setExtent(maxExtent); console.log("max extent reached, rolling back to previous extent"); } }); } dojo.ready(init); </script> </head> <body class="claro"> <div id="map"></div> </body> </html>
... View more
02-27-2019
06:51 AM
|
0
|
2
|
2312
|
POST
|
I'm going to upgrade from 10.5 to 10.6.1 next week and see if this will have any affect.
... View more
01-23-2019
08:13 AM
|
0
|
0
|
712
|
POST
|
When I comment out the esriConfig.portalUrl it does not load anything and I get: "Failed to load portal item" in the Developer Console. No errors at all in the console when I don't have it commented out. It will load the initial view. I click on the second button and it does bring the next view up but not centered on the map(background does not change). I click back on the first button, the background doesn't change, and it does not load the initial view. Very odd.
... View more
01-11-2019
09:27 AM
|
0
|
3
|
712
|
POST
|
Yes Kelly, that is where I got the sample from. I just don't understand why it's not working correctly. Any thoughts?
... View more
01-11-2019
08:49 AM
|
0
|
5
|
712
|
POST
|
I'm trying to swap web maps in the same view using javascript api 4.10. I can get it to work using javascript 4.0. I'm using portal 4.5. The map will come up and I can click the second button and it will go to the second map although it is not centered like in the map viewer and when I try to click the button that opened originally... nothing happens. Please let me know what I may be doing wrong. Thanks in advance. Below is the code: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no"> <title>Swap web maps in the same view - 4.10</title> <style> html, body { font-family: sans-serif; padding: 0; margin: 0; height: 100%; width: 100%; overflow: hidden; } #viewDiv { position: absolute; right: 0; left: 0; top: 60px; bottom: 0; } .header { position: absolute; top: 0; width: 100%; height: 10%; } .btns { margin: 0 auto; display: flex; flex-direction: row; justify-content: center; align-items: center; overflow: auto; } .btn-switch { flex-grow: 4; background-color: rgba(34, 111, 14, 0.5); color: #FFF; margin: 1px; width: 50%; padding: 20px; overflow: auto; text-align: center; cursor: pointer; font-size: 0.7em; } .active-map { color: #fff; background-color: rgba(34, 111, 14, 1); } </style> <link rel="stylesheet" href="https://js.arcgis.com/4.10/esri/css/main.css"> <script src="https://js.arcgis.com/4.10/"></script> <script> require([ "esri/views/MapView", "esri/WebMap", "esri/config", "esri/request" ], function( MapView, WebMap, esriConfig, esriRequest ) { var webmapids = [ "6a8590710dd847ef967b8b45e8439bb4", "3c4662ffe4734f96a610ca4e971d836f", "54204c30cf6b4af79f4b228517a9e82f" ]; /************************************************************ * Create multiple WebMap instances ************************************************************/ esriConfig.portalUrl = "https://xxx.yyyy.com/arcgis/" var webmaps = webmapids.map(function(webmapid) { return new WebMap({ portalItem: { // autocasts as new PortalItem() id: webmapid } }); }); /************************************************************ * Initialize the View with the first WebMap ************************************************************/ var view = new MapView({ map: webmaps[0], container: "viewDiv" }); document.querySelector(".btns").addEventListener("click", function( event) { /************************************************************ * On a button click, change the map of the View ************************************************************/ var id = event.target.getAttribute("data-id"); if (id) { var webmap = webmaps[id]; view.map = webmap; var nodes = document.querySelectorAll(".btn-switch"); for (var idx = 0; idx < nodes.length; idx++) { var node = nodes[idx]; var mapIndex = node.getAttribute("data-id"); if (mapIndex === id) { node.classList.add("active-map"); } else { node.classList.remove("active-map"); } } } }); }); </script> </head> <body> <section class="header"> <div class="btns"> <div class="btn-switch active-map" data-id="0">Button 1</div> <div class="btn-switch" data-id="1">Button 2</div> <div class="btn-switch" data-id="2">Button 3</div> </div> </section> <div id="viewDiv"></div> </body> </html>
... View more
01-09-2019
06:51 AM
|
0
|
7
|
872
|
Online Status |
Offline
|
Date Last Visited |
a month ago
|