POST
|
No, I didn't have an id. I did add it, per your suggestion. I'm getting a similar error. "Tried to register widget with id==timeSlider but that id is already registered" Now it's pointing to the ID and not the timeSliderDiv
... View more
02-11-2014
01:41 PM
|
0
|
0
|
1144
|
POST
|
I did this: function clearTime(){
...
var component = registry.byId("timeSlider");
registry.remove(component);
} I still get the same error as " Tried to register widget with id==timeSliderDiv but that id is already registered" ================== In a separate test, I did this: function initSlider() {
var component = registry.byId("timeSlider");
alert(component);
//if it exists
if (component)
{
registry.remove(component);
}
var timeSlider = new TimeSlider({
style: "width: 100%;"
}, dom.byId("timeSliderDiv"));
... The alert comes back "undefined", both the first time (expected) and the second time (not expected). I get the same error message "Tried to register..."
... View more
02-11-2014
11:58 AM
|
0
|
0
|
1144
|
POST
|
Something isn't quite right yet. The timeSlider is within a function. The clear is in another function. So it cannot find the timeSlider in the clear function. function initSlider() { var timeSlider = new TimeSlider({ style: "width: 100%;" }, dom.byId("timeSliderDiv")); ... function clearTime(){ ... registry.remove(timeSlider); That's one way. ============================= The other way I've tried is: function initSlider() { registry.remove(timeSlider); var timeSlider = new TimeSlider({ style: "width: 100%;" }, dom.byId("timeSliderDiv")); I get the Tried to register widget with id==timeSliderDiv ... error. Thanks for your help. Dorothy
... View more
02-11-2014
11:16 AM
|
0
|
0
|
1144
|
POST
|
Hello. I have a button that triggers the timeSlider. It works great. Then I have a button to clear it - turn off the layer and empty the slider. When I click the button for the timeSlider again, I get this error: Tried to register widget with id==timeSliderDiv but that id is already registered I realize it's trying to initiate the slider again, but I can't seem to properly destroy and redo it on the fly. functrion wrTime(){ ... timeLayer = new FeatureLayer("http://arcgis.wrd.state.or.us/arcgis/rest/services/Dynamic/wr_qry_Time/MapServer/0", {mode: esri.layers.FeatureLayer.MODE_ONDEMAND, id:"time_layer" }); map.addLayers([timeLayer]); connect.connect(map,'layer-add-result', initSlider()); function initSlider() { var timeSlider = new TimeSlider({ style: "width: 100%;" }, dom.byId("timeSliderDiv")); map.setTimeSlider(timeSlider); var timeExtent = new TimeExtent(); timeExtent.startTime = new Date("1/1/1900 UTC"); timeExtent.endTime = new Date("12/31/2014 UTC"); timeSlider.setThumbCount(2); timeSlider.createTimeStopsByTimeInterval(timeExtent, 2, "esriTimeUnitsYears"); timeSlider.setThumbIndexes([0,200]); timeSlider.startup(); } function clearTime(){ // === Turns the theme off === timeLayer.hide(); //===== eliminates the element ==== var element = document.getElementById("timeSliderDiv"); element.outerHTML = ""; delete element; } I've tried various versions of destroy, registry.remove, etc. Then tried recreating the timeSliderDiv, but I am just not getting it right. Mostly, I just want it to appear as if it cleared. If you were to show the slider, I don't care if it refreshes or picks up where it left off. No matter how I slice it, tho, I keep ending up with the same error message. Suggestions?
... View more
02-11-2014
09:55 AM
|
0
|
15
|
7356
|
POST
|
You gotta be kidding me. Stick a sharp stick in my eye. Thank you so much! I NEVER would have found that. You just made my day.
... View more
12-12-2013
09:09 AM
|
0
|
0
|
106
|
POST
|
I take that back. I still think there is some thing different between <script type="text/javascript" src="http://js.arcgis.com/3.7/"></script> and <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/dojo/1.9.1/dojo/dojo.js"></script> Here is a bare bones borderContent. It works with the googleapis, but not with the arcgis verson. This is with the googleapis. switch the commented out arcgis and it wont work.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>WR Map Template</title>
<meta name="description" content="OWRD Water Rights Map Tool" />
<meta name="keywords" content="owrd, water rights, water" />
<meta name="author" content="D. Mortenson" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<link rel="stylesheet" href="http://js.arcgis.com/3.7/js/dojo/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.7/js/esri/css/esri.css">
<script src="http://code.jquery.com/jquery-1.9.0.min.js"></script>
<!-- <script type="text/javascript" src="http://js.arcgis.com/3.7/"></script> -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/dojo/1.9.1/dojo/dojo.js"></script>
<style>
html, body {
width: 100%;
height: 100%;
margin: 0;
overflow:hidden;
}
#borderContainer{
width: 90%;
height: 90%;
border: solid;
padding: 10px;
background-color:#0000FF;
}
</style>
<script>
require(["dojo/parser",
"dojo/ready",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dijit/layout/TabContainer",
"dijit/layout/AccordionContainer",
"dijit/layout/TabController"],
function(parser, ready){
ready(function(){
parser.parse();
});
});
</script>
</head>
<body class="claro">
<div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'sidebar', gutters:true, liveSplitters:true" id="borderContainer">
<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="splitter:true, region:'leading'" style="width: 100px;"> leading pane</div>
<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="splitter:true, region:'center'">center pane</div>
</div>
</body>
</html>
... View more
12-12-2013
07:14 AM
|
0
|
0
|
630
|
POST
|
Right you are! We're getting closer. Now I think it has something to do with the parser and the dojo/ready. I must be missing something obvious. What works (with no map):
require(["dojo/parser",
"dojo/ready",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dijit/layout/TabContainer",
"dijit/layout/AccordionContainer",
"dijit/layout/TabController"],
function(parser, ready){
ready(function(){
parser.parse();
});
});
I've tried various options. Sounds like dojo/ready is good if you will be using widgets (and I will). dojo/domReady! is AMD, which I am trying to do as well. In either case, I can't seem to get it right. What I've tried with adding the map is:
var map;
require(["dojo/parser",
"esri/map",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dijit/layout/TabContainer",
"dijit/layout/AccordionContainer",
"dijit/layout/TabController",
"dojo/domReady!"],
function(parser, Map){
map = new Map("map", {
center: [-70.6508, 43.1452],
zoom: 16,
basemap: "topo"
});
});
... View more
12-11-2013
06:13 AM
|
0
|
0
|
630
|
POST
|
I'm afraid that didn't make a difference. I changed the map script to be all inclusive with the containers and the map.
<script>
require(["esri/map",
"dojo/parser",
"dojo/_base/declare",
"dojo/_base/config",
"dojo/dom",
"dojo/on",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dijit/layout/TabContainer",
"dijit/layout/AccordionContainer",
"dijit/layout/TabController",
"dojo/domReady!"],
function(Map,
parser,
declare,
config,
dom,
on
){
var map = new Map("map", {
center: [-118.8, 43.5],
zoom: 7,
basemap: "topo"
});
});
</script>
The error I get is: Error: defineAlreadyDefined https://ajax.googleapis.com/ajax/libs/dojo/1.9.1/dojo/dojo.js Line 15 Chrome says:
Error {src: "dojoLoader", info: 0} dojo.js.uncompressed.js:1
(anonymous function) dojo.js.uncompressed.js:1
(anonymous function) dojo.js.uncompressed.js:476
f dojo.js.uncompressed.js:209
q.signal dojo.js.uncompressed.js:473
async dojo.js.uncompressed.js:1
(anonymous function) dojo.js.uncompressed.js:1955
Resource interpreted as Script but transferred with MIME type text/plain: "http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer?f=json&callback=dojo.io.script.jsonp_dojoIoScript1._jsonpCallback". init.js:1035
XMLHttpRequest cannot load http://services.arcgisonline.com/ArcGIS/rest/info?f=json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8020' is therefore not allowed access. container_template_seperate.html:1
It seems to matter which comes first:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/dojo/1.9.1/dojo/dojo.js"></script>
<script type="text/javascript" src="http://js.arcgis.com/3.7/"></script>
if the js.arcgis.com is listed second, I get errors saying it's not a "text/javascript". If I take that out, then I still get the same message. If I reverse the order, then I get the errors I listed above.
... View more
12-10-2013
01:30 PM
|
0
|
0
|
630
|
POST
|
Thank you. Yes. I do have it included. I apologize for my brevity. Here's what I have included in the head:
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>WR Map Template</title>
<meta name="description" content="OWRD Water Rights Map Tool" />
<meta name="keywords" content="owrd, water rights, water" />
<meta name="author" content="D. Mortenson" />
<!-- VIEWPORT ====================================================================== -->
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<!-- SET THE STYLES ----------------------------------- -->
<link rel="stylesheet" href="css/css_prod/normalize.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.7/js/dojo/dijit/themes/claro/claro.css" >
<link rel="stylesheet" href="http://js.arcgis.com/3.7/js/esri/css/esri.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.7/js/dgrid/css/dgrid.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.7/js/dojo/dojox/layout/resources/FloatingPane.css">
<link rel="stylesheet" href="css/demo.css" >
<link rel="stylesheet" href="css/style_simple.css" >
<!-- JQUERY ============================================================= -->
<script src="http://js.arcgis.com/3.7/"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/modernizr.custom.js" defer></script>
<script type="text/javascript">
var dojoConfig = {
parseOnLoad: true,
isDebug: true,
locale: 'en-us',
extraLocale: ['ja-jp']
};
</script>
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.9.1/dojo/dojo.js"></script>
<script type="text/javascript" src="js/search_wr_trs_ll.js"></script>
<script type="text/javascript" src="js/grid_wr_pod_pou.js"></script>
<script type="text/javascript" src="js/my_scripts.js"></script> -
<script>
var map;
require([
"esri/map",
"dojo/domReady!"
], function(
Map
) {
map = new Map("map", {
center: [-70.6508, 43.1452],
zoom: 16,
basemap: "topo"
});
});
</script>
</head>
Here's whats in my_script.js:
require(["dojo/parser",
"dojo/ready",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dijit/layout/TabContainer",
"dijit/layout/AccordionContainer",
"dijit/layout/TabController"],
function(parser, ready){
ready(function(){
parser.parse();
});
});
... View more
12-10-2013
11:30 AM
|
0
|
0
|
630
|
POST
|
Thanks for the response. I think I found part of the issue. I had originally used <link rel="stylesheet" href="https://community.esri.com//ajax.googleapis.com/ajax/libs/dojo/1.8.5/dijit/themes/claro/claro.css"> Then I switched to: <link rel="stylesheet" href="http://js.arcgis.com/3.7/js/dojo/dijit/themes/claro/claro.css" > That seemed to help with the libraries. Now I cannot add a map. Within the html, I added a simple map: <script>
var map;
require([
"esri/map",
"dojo/domReady!"
], function(
Map
) {
map = new Map("map", {
center: [-70.6508, 43.1452],
zoom: 16,
basemap: "topo"
});
});
</script> --> Now I get an error of: Error: scriptError
c()dojo.js (line 15)
q.injectUrl/g<()
... View more
12-10-2013
10:51 AM
|
0
|
0
|
630
|
POST
|
I have made two applications that I want to combine. The first was a test to develop the web map I want. I use the <script src="http://js.arcgis.com/3.7/"></script> The second is one that I developed with the dijit/layout/BorderContainer, ContentPane, TabContainer, TabController, AccordionContainer. In other words, the second has all of the panels laid out. Looks nice. It uses <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.8.1/dojo/dojo.js"></script> I have also tried it with <script src="//ajax.googleapis.com/ajax/libs/dojo/1.9.1/dojo/dojo.js"></script> Both work. When I try to put even a simple map into the second application, and have to add the <script src="http://js.arcgis.com/3.7/"></script> , the layout goes bad, like it doesn't know what to do with the containers. Any suggestions? Dorothy
... View more
12-10-2013
09:19 AM
|
0
|
11
|
3011
|
POST
|
Hello, I was using the sample at: https://developers.arcgis.com/en/javascript/jssamples/fl_paging.html There suppose to be a check if there are valid records, but it doesn't work in this sample. I had added an input field and button to be able to do a query. If the query is valid, I get results. If the query produces no results, the grid doesn't clear; it show the records from the previous successful records. Anyone know how to clear the grid without clearing the query string? Thank you. Dorothy
... View more
12-04-2013
10:06 AM
|
0
|
3
|
2437
|
POST
|
Sounds like the answer is it cannot be done, which is unfortunate.
... View more
11-06-2013
01:23 PM
|
0
|
0
|
425
|
POST
|
Did you ever figure this out? I'm just getting into the same boat. Dorothy
... View more
11-06-2013
10:53 AM
|
0
|
0
|
425
|
Title | Kudos | Posted |
---|---|---|
1 | 07-16-2014 02:08 PM | |
1 | 08-20-2015 08:33 AM | |
1 | 12-26-2014 07:34 AM | |
1 | 07-18-2014 11:18 AM | |
1 | 07-10-2014 10:46 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|