|
POST
|
I just removed the tooltips and my print widget works. So the conflict lies there somewhere.
... View more
11-28-2016
08:21 AM
|
0
|
0
|
716
|
|
POST
|
I've recently noticed that my print widget is not working in one of my maps. However, it is working in two other maps. All three maps call to the same service and the same code blocks are used in all maps. The biggest difference I have been able to locate between the maps is that the map where the print widget is not working is in 3.17, where the other two are in 3.14. I'd like to update my code in the one map so the print widget will work as it should. I've looked at the API reference for potential changes, but that hasn't proven to be fruitful. When this map was first released, the print widget was working, so there is the chance the recent addition of tooltips is what has thrown this off. Any ideas? Function and require statement: require([
"dojo/dom-construct",
"esri/map",
"esri/Color",
"dojo/keys",
"esri/sniff",
"esri/SnappingManager",
"esri/renderers/SimpleRenderer",
"esri/config",
"esri/graphic",
"esri/lang",
"esri/geometry/Extent",
"esri/geometry/webMercatorUtils",
"esri/geometry/Point",
"esri/dijit/BasemapGallery",
"esri/dijit/HomeButton",
"esri/dijit/Search",
"esri/dijit/Popup",
"esri/dijit/PopupTemplate",
"esri/dijit/Scalebar",
"esri/dijit/Print",
"esri/dijit/Measurement",
"esri/InfoTemplate",
"esri/layers/ArcGISDynamicMapServiceLayer",
"esri/layers/FeatureLayer",
"esri/tasks/GeometryService",
"esri/tasks/PrintTemplate",
"esri/symbols/SimpleFillSymbol",
"esri/symbols/SimpleLineSymbol",
"esri/symbols/SimpleMarkerSymbol",
"esri/symbols/PictureMarkerSymbol",
"esri/toolbars/draw",
"esri/urlUtils",
"esri/request",
"esri/SpatialReference",
"agsjs/dijit/TOC",
"dojo/_base/array",
"dojo/aspect",
"dojo/dom",
"dojo/dom-style",
"dojo/ready",
"dojo/on",
"dijit/TooltipDialog",
"dijit/popup",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dijit/TitlePane",
"dijit/form/Button",
"dojo/domReady!"],
function (domConstruct, Map, Color, keys, has, SnappingManager, SimpleRenderer, esriConfig, Graphic, esriLang, Extent, webMercatorUtils, Point, BasemapGallery, HomeButton, Search, Popup, PopupTemplate, Scalebar, Print, Measurement, InfoTemplate, ArcGISDynamicMapServiceLayer, FeatureLayer, GeometryService, PrintTemplate, SimpleFillSymbol, SimpleLineSymbol, SimpleMarkerSymbol, PictureMarkerSymbol, Draw, urlUtils, esriRequest, SpatialReference, TOC, array, aspect, dom, domStyle, ready, on, TooltipDialog, dijitPopup
) Layouts: var myLayouts = [{
"name": "Print_Landscape",
"label": "Landscape",
"format": "pdf",
"options": {
"legendLayers": [], // empty array means no legend
"scalebarUnit": "Miles",
"titleText": "State Parks"
}
}, {
"name": "Print_Portrait",
"label": "Portrait",
"format": "pdf",
"options": {
"legendLayers": [],
"scaleBarUnit": "Miles",
"titleText": "State Parks"
}
}];
/*
* Step: create the print templates
*/
var myTemplates = [];
dojo.forEach(myLayouts, function (lo) {
var t = new PrintTemplate();
t.layout = lo.name;
t.label = lo.label;
t.format = lo.format;
t.layoutOptions = lo.options
myTemplates.push(t);
}); Print Widget: var printMap = new Print({
map: mapMain,
async: true,
url: "https://conservationgis.alabama.gov/adcnrweb/rest/services/DCNRExportWebMap/GPServer/Export%20Web%20Map",
templates: myTemplates
}, dom.byId("PrintButton"));
printMap.startup(); Tooltips: tooltips.setRenderer(new SimpleRenderer(tooltipFill));
tooltips.on('mouse-over', mouseOverGraphic);
tooltips.on('mouse-out', mouseOutGraphic);
//mouse over graphic
function mouseOverGraphic(evt) {
//disableTimer();
mapMain.infoWindow.clearFeatures();
mapMain.infoWindow.setTitle(" ");
mapMain.infoWindow.setContent(evt.graphic.attributes.NAME);
mapMain.infoWindow.show(evt.screenPoint);
}
function mouseOutGraphic(evt) {
timedClose();
}
function timedClose() {
clearTimeout(timer);
timer = setTimeout(
function() {
mapMain.infoWindow.hide();
}, 2000);
}
function disableTimer() {
clearTimeout(timer);
}
//I am using mapinfowindow so I attach mouseover and mouseout to the infowindow
infoWinMouseOver = on(mapMain.infoWindow.domNode, 'mouseover', function() {
disableTimer();
});
infoWinMouseOut = on(mapMain.infoWindow.domNode, 'mouseout', function() {
timedClose();
});
... View more
11-28-2016
08:17 AM
|
0
|
1
|
1174
|
|
POST
|
Thanks Robert! I'll see if I can get that implemented.
... View more
09-26-2016
06:44 AM
|
0
|
0
|
1202
|
|
POST
|
I have implemented the Feature Layer Hover sample in my map. I've added in a max scale to control when the tooltips are shown. I'd also like to be able to hide the tooltips after a certain period of time so they do not continue to block the user's view. I've tried a few different options, without success. I reworked my code a bit to try the solution I found here, but I didn't have much luck. I wasn't sure whether it was best to use a hide or setTimeout, or maybe even an if/else statement. Any suggestions appreciated. My code as it currently stands: tooltips.setRenderer(new SimpleRenderer(tooltipFill));
dialog = new TooltipDialog({
id: "tooltipDialog"
//style: "position: absolute; font: normal normal normal 10pt Helvetica;z-index:100"
});
dialog.startup();
mapMain.on("load", function (){
mapMain.graphics.enableMouseEvents();
mapMain.graphics.on("mouse-out", closeDialog);
});
tooltips.on("mouse-over", function (evt){
var parksTooltips = "${NAME}";
var content = esriLang.substitute(evt.graphic.attributes, parksTooltips);
var highlightGraphic = new Graphic(evt.graphic.geometry, tooltipFill);
mapMain.graphics.add(highlightGraphic);
dialog.setContent(content);
domStyle.set(dialog.domNode, "opacity", 0.85);
dijitPopup.open({
popup: dialog,
x: evt.pageX,
y: evt.pageY
});
});
function closeDialog() {
mapMain.graphics.clear();
dijitPopup.close(dialog);
}
... View more
09-23-2016
01:27 PM
|
0
|
2
|
2287
|
|
POST
|
Thanks Robert! My hover still isn't working, but that at least helps me move forward from this issue.
... View more
09-23-2016
10:21 AM
|
0
|
0
|
2148
|
|
POST
|
Robert, Thanks for taking a moment to look this over. Here are the sections of code that I've added for the tooltip: Require and function statements: require([
"dojo/dom-construct",
"esri/map",
"esri/Color",
"dojo/keys",
"esri/sniff",
"esri/SnappingManager",
"esri/renderers/SimpleRenderer",
"esri/config",
"esri/graphic",
"esri/lang",
"esri/geometry/Extent",
"esri/geometry/webMercatorUtils",
"esri/geometry/Point",
"esri/dijit/BasemapGallery",
"esri/dijit/HomeButton",
"esri/dijit/Search",
"esri/dijit/Popup",
"esri/dijit/PopupTemplate",
"esri/dijit/Scalebar",
"esri/dijit/Print",
"esri/dijit/Measurement",
"esri/InfoTemplate",
"esri/layers/ArcGISDynamicMapServiceLayer",
"esri/layers/FeatureLayer",
"esri/tasks/GeometryService",
"esri/tasks/PrintTemplate",
"esri/symbols/SimpleFillSymbol",
"esri/symbols/SimpleLineSymbol",
"esri/symbols/SimpleMarkerSymbol",
"esri/symbols/PictureMarkerSymbol",
"esri/toolbars/draw",
"esri/graphic",
"esri/urlUtils",
"esri/request",
"esri/SpatialReference",
"agsjs/dijit/TOC",
"dojo/_base/array",
"dojo/aspect",
"dojo/dom",
"dojo/dom-style",
"dojo/ready",
"dojo/on",
"dojo/domReady!",
"dijit/TooltipDialog",
"dijit/popup",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dijit/TitlePane",
"dijit/form/Button"],
function (domConstruct, Map, Color, keys, has, SnappingManager, SimpleRenderer, esriConfig, Graphic, esriLang, Extent, webMercatorUtils, Point, BasemapGallery, HomeButton, Search, Popup, PopupTemplate, Scalebar, Print, Measurement, InfoTemplate, ArcGISDynamicMapServiceLayer, FeatureLayer, GeometryService, PrintTemplate, SimpleFillSymbol, SimpleLineSymbol, SimpleMarkerSymbol, PictureMarkerSymbol, Draw, Graphic, urlUtils, esriRequest, SpatialReference, TOC, array, aspect, dom, domStyle, ready, on, TooltipDialog, dijitPopup
) Symbol creation: var tooltipFill = new SimpleFillSymbol ("solid", new Color([0, 0, 0, 1.25])); URL call: var tooltipURL = "https://conservationgis.alabama.gov/adcnrweb/rest/services/StateParksInfo/MapServer/2"; Feature layer: var tooltips = new FeatureLayer(tooltipURL, {
mode: FeatureLayer.MODE_SNAPSHOT,
outFields: ["NAME"]
}); Add layers to map: mapMain.addLayers([boundaries, parks, photos, tooltips]); The code in my original post would be further down in my .js file. If needed, I can send you the entire file.
... View more
09-23-2016
08:36 AM
|
0
|
2
|
2148
|
|
POST
|
I am trying to add the tooltips feature to my map, following the sample code for the Feature Layer Hover. I have everything added in, but I am receiving an error that states 'TooltipDialog is not a constructor'. I've double-checked my require and function statements at the beginning of my .js file and all of the necessary items are listed. Has anyone else run into this with this particular sample? Here's the bulk of my code for the feature layer hover. I've called in the feature layer and created the necessary symbols in other portions of my .js file. tooltips.setRenderer(new SimpleRenderer(tooltipFill));
var dialog = new TooltipDialog({
id: "tooltipDialog",
style: "position: absolute; width: 250px; font: normal normal normal 10pt Helvetica;z-index:100"
});
dialog.startup();
mapMain.on("load", function (){
mapMain.graphics.enableMouseEvents();
mapMain.graphics.on("mouse-out", closeDialog);
});
tooltips.on("mouse-over", function (evt){
var parksTooltips = "${NAME}";
var content = esriLang.substitute(evt.graphic.attributes, parksTooltips);
var highlightGraphic = new Graphic(evt.graphic.geometry, tooltipFill);
mapMain.graphics.add(highlightGraphic);
dialog.setContent(content);
domStyle.set(dialog.domNode, "opacity", 0.85);
dijitPopup.open({
popup: dialog,
x: evt.pageX,
y: evt.pageY
});
});
function closeDialog() {
mapMain.graphics.clear();
dijitPopup.close(dialog);
}
... View more
09-23-2016
08:09 AM
|
0
|
4
|
3613
|
|
POST
|
Adrian, I've tried a multitude of things at this point. The issue is that Flickr limits their feeds to the 20 most recently geotagged/tagged photos. It looks like you can increase the number from 20, but I really think it will require me using the Flickr API. The sample I mentioned previously I was able to pretty much drop straight into my code. Here's what that section looks like for me now: //Add Flickr photos
mapMain.on("load", loadPhotos);
function loadPhotos(){
mapMain.graphics.setMinScale(1300000);
mapMain.graphics.setMaxScale(20000);
var flickrPhotos = esriRequest({
url: "https://api.flickr.com/services/feeds/geo?&format=json",
content:{
id: "54972228@N03",
//format:"json",
//tagmode: "any",
tags: "State Park"
},
callbackParamName: "jsoncallback"
});
flickrPhotos.then(addPhotos);
}
function addPhotos(data){
var symbol = new PictureMarkerSymbol("images/flickr.png", 24, 24);
var template = new PopupTemplate({
title: "{title}",
description:"{description}"
});
dojo.forEach(data.items, function(item){
var loc = new Point(item.longitude, item.latitude);
mapMain.graphics.add(new Graphic(loc, symbol, item, template));
});
} I updated the code from the sample and added in the scale to control when the Flickr icons are visible. This works, but only shows 20 photos. I have 65 that need to be visible. Hope this helps.
... View more
07-08-2016
06:08 AM
|
1
|
1
|
1454
|
|
POST
|
Kelly, Thanks for the information. I've looked into Yahoo Pipes, and that is no longer an option. Yahoo did away with that in September 2015. I'll check out the template you mention that uses the Flickr API to see if that gets me any closer to a solution.
... View more
07-08-2016
06:00 AM
|
0
|
0
|
1454
|
|
POST
|
I'm continuing to try to resolve this issue. I think it will require me using the Flickr API. Has anyone else dealt with this?
... View more
07-07-2016
01:48 PM
|
0
|
0
|
1454
|
|
POST
|
I am currently pulling in the Flickr geofeed into my map, based on this sample: Flickr data as graphics on a map | ArcGIS API for JavaScript 3.17. It is working beautifully. Right now, I only see 20 photos on my map. I have 65 geotagged photos in the feed (single user's photos) that I'm pulling. I also limit what I am pulling by using tags. The default number of photos to show looks to be 20, but I'm guessing there is a way I can increase that number. I haven't been able to find how to do that though. Has anyone else run into this and how did you resolve it? Thanks in advance for your help!
... View more
07-01-2016
08:30 AM
|
0
|
6
|
3501
|
|
POST
|
I had a similar problem using the print widget with the JavaScript API. After talking with Esri, my problem was caused by a setting on the host file on the server that ArcGIS Server is on.
... View more
06-13-2016
05:58 AM
|
1
|
0
|
1234
|
|
POST
|
Actually Robert, I just found my copy of the build. I've got everything back up and running as it should be. Thanks!
... View more
05-13-2016
10:56 AM
|
0
|
0
|
2346
|
|
POST
|
Robert, If you could pass that along, it would be great. Thanks! Ashley
... View more
05-13-2016
09:27 AM
|
0
|
1
|
2346
|
|
POST
|
I am using this TOC in my maps. As of yesterday, they are not working. Looking at the links, they are throwing a 404 error. Is anyone else having this problem? Did you find a resolution? Thanks in advance! Ashley
... View more
05-13-2016
07:22 AM
|
0
|
9
|
4468
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-30-2025 01:35 PM | |
| 1 | 08-31-2023 01:21 PM | |
| 1 | 02-04-2025 06:23 AM | |
| 1 | 08-21-2023 01:28 PM | |
| 1 | 03-04-2024 01:50 PM |
| Online Status |
Offline
|
| Date Last Visited |
2 weeks ago
|