|
POST
|
I think this should take you to it on JSFiddle: Link
... View more
08-13-2015
12:06 PM
|
0
|
0
|
586
|
|
POST
|
Thanks Chris, I've got it working now. I had a capitalization issue, LINK should have been Link. Ashley
... View more
08-12-2015
12:15 PM
|
1
|
1
|
1679
|
|
POST
|
I have a field in my attribute table that contains a link to a web page. In Flex, I was able to create a hyperlink using this field to populate the appropriate place in my popup. I'd like to do the same now with JavaScript. I have the InfoTemplate set up and it looks perfect. However, when I click on the link, a new browser page is opened, but it does not go to the link contained in my attribute table. Instead, it is opening a new page of the project I'm working on. How do I need to rewrite the href section of this code for the link to work? Thanks in advance for your help! Here's my code: var stateParksInfoTemplate = new InfoTemplate(); stateParksInfoTemplate.setTitle("<b>${NAME}</b>"); var stateParksInfoContent = "<div class=\"InfoContent\">" + "For more information on <b>${NAME}</b>, please <a href='${LINK}' target='_blank'><font color='0x84CCDA'>click here</font></a>." + "</div>"; stateParksInfoTemplate.setContent(stateParksInfoContent);
... View more
08-12-2015
11:39 AM
|
0
|
3
|
4137
|
|
POST
|
Dominik, You may have resolved this problem by now. But, I ran into the same issue earlier this week. I was just able to resolve it by following this example: Add two dynamic maps | ArcGIS API for JavaScript . Maybe it will work for you as well. Ashley
... View more
08-12-2015
06:29 AM
|
0
|
0
|
3351
|
|
POST
|
I managed to solve the problem. I rewrote my code to follow this example: Add two dynamic maps | ArcGIS API for JavaScript. It fixed the zoom issue. I had overlooked an issue where I declared some of the layers ("MapServer" was missing at the end). Fixed that as well. Now all things are working as expected.
... View more
08-12-2015
06:28 AM
|
0
|
0
|
1380
|
|
POST
|
And I am getting this error, presumably for the layers it isn't drawing: "dojo.io.script error" [object Error] { code: 400, description: "", details: [], httpCode: 400, log: undefined, message: "Invalid URL", number: 0}
... View more
08-10-2015
12:55 PM
|
0
|
1
|
1380
|
|
POST
|
I don't currently have JSFiddle or JSBin downloaded, but I'll see if I can get one of them onto my computer. Here's the portion of my .js file dealing with the TOC dijit: //Declare Base Layers to map var boundaries = new ArcGISDynamicMapServiceLayer("https://MyURL/rest/services/Basemap/MapServer"); //Declare State Parks layers var stateparksL = new FeatureLayer("https://MyURL/rest/services/SP_DCNR/MapServer/1"); var stateparksentL = new FeatureLayer("https://MyURL/rest/services/SP_DCNR/MapServer/0"); //Declare Hunting layers var WMA = new FeatureLayer("https://MyURL/rest/services/Hunting_DCNR/MapServer/2"); var ranges = new FeatureLayer("https://MyURL/rest/services/Hunting_DCNR/MapServer/1"); var checkStations = new FeatureLayer("https://MyURL/rest/services/Hunting_DCNR/MapServer/0"); //Declare FW layers var SLDtracts = new FeatureLayer("https://MyURL/rest/services/FW_DCNR/MapServer/13"); var FWtracts = new FeatureLayer("https://MyURL/rest/services/FW_DCNR/MapServer/12"); var BartramPOI = new FeatureLayer("https://MyURL/rest/services/FW_DCNR/MapServer/11"); var BartramRoutes = new FeatureLayer("https://MyURL/rest/services/FW_DCNR/MapServer/10"); var BartramTrail = new FeatureLayer("https://MyURL/rest/services/FW_DCNR/MapServer/9"); var FWtrails = new FeatureLayer("https://MyURL/rest/services/FW_DCNR/MapServer/8"); var FWaccess = new FeatureLayer("https://MyURL/rest/services/FW_DCNR/MapServer/7"); var FWactivities = new ArcGISDynamicMapServiceLayer("https://MyURL/rest/services/FW_DCNR/MapServer"); FWactivities.setVisibleLayers([1,2,3,4,5,6]); //Declare Fishing layers var publicLakes = new FeatureLayer("https://MyURL/rest/services/Fishing_DCNR/MapServer/6"); var boatRamps = new FeatureLayer("https://MyURL/rest/services/Fishing_DCNR/MapServer/5"); var navAids = new FeatureLayer("https://MyURL/rest/services/Fishing_DCNR/MapServer/4"); var offshoreReefs = new FeatureLayer("https://MyURL/rest/services/Fishing_DCNR/MapServer/3"); var nearshoreReefs = new FeatureLayer("https://MyURL/rest/services/Fishing_DCNR/MapServer/2"); var inshoreReefs = new FeatureLayer("https://MyURL/rest/services/Fishing_DCNR/MapServer/1"); //Declare Districts var WFFDistricts = new FeatureLayer("https://MyURL/rest/services/Districts_WGS84/0"); //Declare Offices and Facilities var hatcheries = new FeatureLayer("https://MyURL/rest/services/OfficesFacilities_WGS84/6"); var SLDFacilities = new FeatureLayer("https://MyURL/rest/services/OfficesFacilities_WGS84/5"); var Facilities = new FeatureLayer("https://MyURL/rest/services/OfficesFacilities_WGS84/4"); var WFFDistOff = new FeatureLayer("https://MyURL/rest/services/OfficesFacilities_WGS84/3"); var MRDOffices = new FeatureLayer("https://MyURL/rest/services/OfficesFacilities_WGS84/2"); var Offices = new FeatureLayer("https://MyURL/rest/services/OfficesFacilities_WGS84/1"); var DCNRHQ = new FeatureLayer("https://MyURL/rest/services/OfficesFacilities_WGS84/0"); //Add all declared layers to map mapMain.addLayers([boundaries, stateparksL, WMA, ranges, checkStations, SLDtracts, FWtracts, BartramPOI, BartramRoutes, BartramTrail, FWtrails, FWaccess, FWactivities, publicLakes, boatRamps, navAids, offshoreReefs, nearshoreReefs, inshoreReefs, WFFDistricts, hatcheries, SLDFacilities, Facilities, WFFDistOff, MRDOffices, Offices, DCNRHQ]); //Add TOC widget once all layers have been added to the map mapMain.on('layers-add-result', function(evt){ // overwrite the default visibility of service. // TOC will honor the overwritten value. //dynaLayer1.setVisibleLayers([2, 5, 8, 11]); //try { toc = new TOC({ map: mapMain, layerInfos: [{ layer: DCNRHQ, title: 'DCNR Headquarters' }, { layer: Offices, title: 'Offices' }, { layer: MRDOffices, title: 'Marine Resources Division Offices' }, { layer: WFFDistOff, title: 'Wildlife and Freshwater Fisheries District Offices' }, { layer: Facilities, title: 'Facilities' }, { layer: SLDFacilities, title: 'State Lands Facilities' }, { layer: hatcheries, title: 'Hatcheries' }, { layer: WFFDistricts, title: 'Wildlife and Freshwater Fisheries Districts' }, { layer: inshoreReefs, title: 'Inshore Artificial Reefs' }, { layer: nearshoreReefs, title: 'Nearshore Artificial Reefs' }, { layer: offshoreReefs, title: 'Offshore Artificial Reefs' }, { layer: navAids, title: 'Navigational Aids' }, { layer: boatRamps, title: 'DCNR-managed Boat Ramps' }, { layer: publicLakes, title: 'DCNR-owned Public Fishing Lakes' }, { layer: FWactivities, title: 'Activities' }, { layer: FWaccess, title: 'Parking and Access' }, { layer: FWtrails, title: 'Trails' }, { layer: BartramTrail, title: 'Bartram Canoe Trail' }, { layer: BartramRoutes, title: 'Routes' }, { layer: BartramPOI, title: 'Points of Interest' }, { layer: FWtracts, title: 'Forever Wild Tracts' }, { layer: SLDtracts, title: 'State Lands Division Recreational Tracts' }, { layer: checkStations, title: 'Checking Stations' }, { layer: ranges, title: 'Ranges' }, { layer: WMA, title: 'Wildlife Management Areas' }, { layer: stateparksentL, title: 'State Parks Entrances' }, { layer: stateparksL, title: 'State Parks' }, { layer: boundaries, title: 'States and Counties', noLegend: true //collapsed: false, // whether this root layer should be collapsed initially, default false. //slider: false // whether to display a transparency slider. }] }, 'tocDiv'); toc.startup(); });
... View more
08-10-2015
12:45 PM
|
0
|
3
|
1380
|
|
POST
|
I'm still new to the JavaScript API, so please bear with me. I am having a similar issue as to what Dominik mentions here: Problems with TOC or map I do not have the Editor or Measurement dijit added in. Right now, I am missing several layers in the TOC. When using the developer tools in Firefox, I get an error that the graphic can not be drawn. They happen to all be point layers, but other point layers are pulling in without throwing that error. Also, when I zoom on the map, the map is not updating unless I pan. When I pan, the polygons are not drawing. If I do not pan, the resolution never gets any better. Any ideas? Thanks in advance! Ashley
... View more
08-10-2015
11:54 AM
|
0
|
5
|
3696
|
|
POST
|
Sarah, I haven't tried that, but it sounds like it may be worth the effort. I'm new to JavaScript, so I'm trying to keep things as simple as possible. So right now, though the HomeButton dijit is acting a little wonky, it's usable. But I'll give that a shot once I feel more confident in my JavaScript writing capabilities! Ashley
... View more
08-07-2015
09:31 AM
|
0
|
1
|
2580
|
|
POST
|
I tested the idea of the wkid being an issue. My services had 2 wkids. I fixed those where they all have the same wkid now. I also re-did my initial extent to reflect the new wkid. The map still moves when I press the home button.
... View more
08-06-2015
07:17 AM
|
0
|
5
|
2580
|
|
POST
|
Here's the portion of the .js file I've modified that deals with the HomeButton and initial extent. I know I likely don't need the center, extent and zoom constructors in the map, but I've been trying a multitude of different things to resolve the map bumping away. If you need the rest of the code, let me know and I'll post it. *Edit - Looking further, could this be a wkid issue? var extentInitial = new Extent({ "xmin": -9850000, "ymin": 3400000, "xmax": -9320000, "ymax": 4300000, "spatialReference": { "wkid": 102100 } }); // Create the map mapMain = new Map("cpCenter", { basemap: "satellite", //center: [-85.6, 34.4], extent: extentInitial, zoom: 7 }); // Add BasemapGallery widget to the map var basemapGallery = new BasemapGallery ({ showArcGISBasemaps: true, map: mapMain}, "basemapGallery"); basemapGallery.startup(); // Add HomeButton widget to the map var home = new HomeButton({ map: mapMain, extent: extentInitial }, "HomeButton"); home.startup();
... View more
08-06-2015
06:29 AM
|
0
|
6
|
2580
|
|
POST
|
Robert, I did use the constructors yesterday before I posted the initial question. I should have mentioned that. I had previously created an initial extent to use within my map. I used that same variable in the HomeButton with the extent constructor. As soon as I open the map, I can hit the HomeButton and it will automatically move to the northeast of where I have it set. I haven't tried hardcoding the extent in to see if that would work, but I'm not sure what else to try. Ashley
... View more
08-06-2015
05:53 AM
|
0
|
8
|
2580
|
|
POST
|
I've added the HomeButton dijit into my map. When it is first opened, the map is centered on the state of Alabama. When the HomeButton is pressed, the extent moves to the northeast and is centered on the eastern Tennesse area. Has anyone else experienced this or know a way to resolve it? Thanks in advance!
... View more
08-05-2015
02:26 PM
|
0
|
12
|
6085
|
|
POST
|
Robert, It is weird. Sometimes I can get it to replicate, other times I can't. I am thinking it could be a client-side issue, or something to do with some of our security settings. Right now, I'm having the issue on my computer, but others who don't use the sites as much aren't having a problem. Ashley
... View more
03-19-2014
05:56 AM
|
0
|
0
|
759
|
| 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 |
12-03-2025
11:15 AM
|