|
POST
|
I believe the sandbox is currently broken (It was a few days ago, for sure). However, it looks like you've found the solution to your problem already; awesome!
... View more
10-11-2013
06:58 AM
|
0
|
0
|
1564
|
|
POST
|
I am modifying the Basic viewer, and the code exported is already in AMD format: http://www.arcgis.com/apps/OnePane/basicviewer/index.html Would you mind sharing the AMDified version of the Basic Viewer? I'd love to take a look and play around with it. I notice you are still using legacy-style DOJO in your code, rather than AMD. Legacy Code Example: dojo.require("esri.dijit.HomeButton");
... View more
10-11-2013
06:52 AM
|
0
|
0
|
2402
|
|
POST
|
Well, if you think about it, having that function in another file, outside of the require block, means it doesn't have access to DOJO and ESRI functions because of scope. For example, if the following function is in another file, there is no context for what a SimpleMarkerSymbol and a Graphic are. So, logically, this will fail.
function showLocation(evt) {
try{
map.graphics.clear();
var point = evt.result.feature.geometry;
var symbol = new SimpleMarkerSymbol().setStyle(
SimpleMarkerSymbol.STYLE_SQUARE).setColor(
new Color([255, 0, 0, 0.5])
);
var graphic = new Graphic(point, symbol);
map.graphics.add(graphic);
map.infoWindow.setTitle("Search Result");
map.infoWindow.setContent(evt.result.name);
map.infoWindow.show(evt.result.feature.geometry);
}catch(e){
console.log(e);
}
}
Error Message in console: ReferenceError: SimpleMarkerSymbol is not defined If you *really* want to move functions that require DOJO into other files, create a Class, Widget or Module and call it via the DOJO loader. Check out the following tutorials: https://developers.arcgis.com/en/javascript/jstutorials/intro_javascript_classes.html https://developers.arcgis.com/en/javascript/jstutorials/intro_custom_dijit.html There are also some great articles on the DOJO blog. Otherwise, keep the function within your require block.
... View more
10-11-2013
06:46 AM
|
0
|
0
|
918
|
|
POST
|
Hi ganeshssac I ran your code locally and it successfully created a point with a red, semi-transparent square. What is the error message you are receiving in the console? If no errors are appearing, wrap the problematic code in a try/catch and check again for errors.
... View more
10-10-2013
02:36 PM
|
0
|
0
|
918
|
|
POST
|
Hey jdkitzmi, 1) What webserver are you using to run the app locally on your machine? (IIS, apache, etc) 2) Might be a proxy issue. Make sure your proxy is set up correctly. 3) What version of IE are you using? The sample (https://developers.arcgis.com/en/javascript/jssamples/query_buffer.html) works on my end in IE10 (I also tested IE9; it works but its incredibly slow). I'll check out your jsfiddle in a few minutes and get back to you. *edit For the future: To quickly get your jsfiddle to work properly, you can just post all of your code inside the "HTML" window (head, scripts, styles, body... etc). It's not very clean and I don't encourage doing that often but it works if you need to make a quick jsfiddle to show functionality.
... View more
10-10-2013
01:02 PM
|
0
|
0
|
1197
|
|
POST
|
Just had a chance to look the page you linked. It looks like a fairly old template that utilizes the legacy style of DOJO. If you look at the source, you can see several additional javascript files are included. The Home button logic is located in the map.js script file. <script type="text/javascript" src="javascript/map.js"></script> But, again, this is fairly old and you may want to look at writing your application in AMD style. Sometime in the future, DOJO 2.0 will be released and the legacy style will no longer be supported in newer versions of the ESRI JSAPI. At that point, upgrading to the newest ESRI JSAPI would entail rewriting your entire application to follow AMD style.
... View more
10-10-2013
12:53 PM
|
0
|
0
|
2402
|
|
POST
|
Good luck Jay! If you have any additional questions, comments or concerns, feel free to bring them up in a new thread or private message. We'll help as best we can.
... View more
10-10-2013
12:48 PM
|
0
|
0
|
3284
|
|
POST
|
Hello, We are having the same issue with dynamic map services displayed with a applicaton develoed in Silverlight. I would like to try the png32 solution, but don't know where to apply this setting. Could you provide some addtional information on how to apply this. Thanks Hi Andy, Welcome to the forums! With that said, this topic is fairly old and you may not receive the answer you are looking for. I would suggest opening a thread over at the Silverlight sub-forum.
... View more
10-10-2013
09:50 AM
|
0
|
0
|
970
|
|
POST
|
Need more info. What are the error messages you get in the console? If no error messages show up, try to identify *where* the error is happening and wrap that code in a try/catch. You should then see an error message. Post it/them here and I can take a look. If you still can't produce any error messages, recreate your page in a http://jsfiddle.net/ so we can work with your code directly.
... View more
10-10-2013
09:40 AM
|
0
|
0
|
1744
|
|
POST
|
The Javascript API is what you are looking for. Javascript generally works in any (modern) browser on any device.
... View more
10-10-2013
09:37 AM
|
0
|
0
|
3284
|
|
POST
|
Hi, First thing that I noticed is that your require statement is wrong.
require([
"esri/map",
"esri/dijit/BasemapToggle",
"dojo/domReady!",
"esri/layers/ArcGISDynamicMapServiceLayer",
"esri/dijit/Popup",
"esri/arcgis/utils",
"esri/dijit/PopupMobile",
"dojo/dom-construct",
], function(
Map, ArcGISDynamicMapServiceLayer, arcgisUtils,
Popup
) {
Should be something like:
require([
"esri/map",
"esri/dijit/BasemapToggle",
"esri/layers/ArcGISDynamicMapServiceLayer",
"esri/dijit/Popup",
"esri/arcgis/utils",
"esri/dijit/PopupMobile",
"dojo/dom-construct",
"dojo/domReady!",
],function(
Map,
BasemapToggle,
ArcGISDynamicMapServiceLayer,
Popup,
arcgisUtils,
PopupMobile,
domConstruct
) {
The modules and their namespace declarations need to be invoked in the same order. Your modules are being matched with the wrong namespace declarations. For example, you are matching ArcGISDynamicMapServiceLayer with "esri/dijit/BasemapToggle", and Popup with "esri/layers/ArcGISDynamicMapServiceLayer". Please read this article for the 'Hows and Whys': http://dojotoolkit.org/documentation/tutorials/1.9/modern_dojo/
... View more
10-10-2013
08:59 AM
|
0
|
0
|
802
|
|
POST
|
Hi jsn, Have you checked out the 'Whats New in Version 3.7?' page? (https://developers.arcgis.com/en/javascript/jshelp/whats_new.html) It has some samples that you may find useful, like the following: https://developers.arcgis.com/en/javascript/jssamples/widget_home.html Hope this helps.
... View more
10-10-2013
08:53 AM
|
0
|
0
|
2402
|
|
POST
|
I'd need to see more code to be able to give specific advice. It's very hard to tell from this small code snippet. Otherwise, here are some questions: Does the slider function work (outside of changing the transparency)? Are you able to change the transparency directly, without the slider? Have you used a try/catch to identify where the problem occurs? Is there an error message? And lastly, can you replicate your issue in a http://jsfiddle.net/ ?
... View more
10-03-2013
08:18 AM
|
0
|
0
|
1212
|
|
POST
|
Your map has an id of 'map' but you are assigning the map object to "mapDiv" Ran your code locally, changed that and it works. (Also, make sure your map div has a height and width of 100%) Code below: <!DOCTYPE html> <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"> <!--The viewport meta tag is used to improve the presentation and behavior of the samples on iOS devices--> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/> <title></title> <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"> <style> html, body, #map { height: 100%; width: 100%; margin: 0; padding: 0; } </style> <script src="http://js.arcgis.com/3.7/"></script> <script> var map; require([ "esri/map", "esri/dijit/BasemapGallery", "esri/arcgis/utils", "dojo/parser", "dojo/ready", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dijit/TitlePane", "dojo/domReady!" ], function( Map, BasemapGallery, arcgisUtils, parser, ready ) { ready(function () { parser.parse(); arcgisUtils.createMap("ff0591055e3541ab951f3494c3553181", "map").then(function (response) { map = response.map; //add the basemap gallery, in this case we'll display maps from ArcGIS.com including bing maps var basemapGallery = new BasemapGallery({ showArcGISBasemaps: true, map: map }, "basemapGallery"); basemapGallery.startup(); basemapGallery.on("error", function(msg) { console.log("basemap gallery error: ", msg); }); }); }); }); </script> </head> <body class="claro"> <div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'headline', gutters:false" style="width:100%;height:100%;margin:0;"> <div id="map" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'" style="padding:0;"> <div style="position:absolute; right:20px; top:10px; z-Index:999;"> <div data-dojo-type="dijit/TitlePane" data-dojo-props="title:'Switch Basemap', closable:false, open:false"> <div data-dojo-type="dijit/layout/ContentPane" style="width:380px; height:280px; overflow:auto;"> <div id="basemapGallery" ></div></div> </div> </div> </div> </div> </body> </html>
... View more
10-02-2013
02:47 PM
|
0
|
0
|
1143
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-26-2014 09:56 AM | |
| 1 | 09-18-2014 11:50 AM | |
| 1 | 09-19-2014 11:28 AM | |
| 1 | 07-09-2014 01:43 PM | |
| 1 | 07-09-2014 02:05 PM |
| Online Status |
Offline
|
| Date Last Visited |
08-14-2024
05:31 PM
|