|
POST
|
I am using this to create a fill symbol for a draw tool How can I midify it to have a real thing dark blue border? Thanks var fillSymbol = new SimpleFillSymbol( SimpleFillSymbol.STYLE_SOLID, new SimpleLineSymbol( SimpleLineSymbol.STYLE_SOLID, new Color([255,255,255,0.35]), 1 ), new Color([125,125,125,0.35]) );
... View more
01-25-2014
11:38 AM
|
0
|
2
|
871
|
|
POST
|
I remove it and the map does not draw...this is all my code in the script I still want Topo and it to center and zoom and a slider <script>
var map, tb;
require([
"esri/map", "esri/toolbars/draw", "esri/arcgis/utils",
"esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol",
"esri/symbols/PictureFillSymbol", "esri/symbols/CartographicLineSymbol",
"esri/graphic",
"dojo/_base/Color", "dojo/dom", "dojo/on", "dojo/domReady!"
], function(
Map, Draw, arcgisUtils,
SimpleMarkerSymbol, SimpleLineSymbol,
PictureFillSymbol, CartographicLineSymbol,
Graphic, Color, dom, on
) {
arcgisUtils.createMap("7f843bb0a37849f68a5a2cc3d2b06288", "mapDiv").then(function (response) {
map = response.map;
});
map = new Map("mapDiv", {
basemap: "topo",
center: [-77.4329, 37.5410],
zoom: 7,
slider: true
});
map.on("load", initToolbar);
// markerSymbol is used for point and multipoint, see http://raphaeljs.com/icons/#talkq for more examples
var markerSymbol = new SimpleMarkerSymbol();
markerSymbol.setPath("M16,4.938c-7.732,0-14,4.701-14,10.5c0,1.981,0.741,3.833,2.016,5.414L2,25.272l5.613-1.44c2.339,1.316,5.237,2.106,8.387,2.106c7.732,0,14-4.701,14-10.5S23.732,4.938,16,4.938zM16.868,21.375h-1.969v-1.889h1.969V21.375zM16.772,18.094h-1.777l-0.176-8.083h2.113L16.772,18.094z");
markerSymbol.setColor(new Color("#00FFFF"));
// lineSymbol used for freehand polyline, polyline and line.
var lineSymbol = new CartographicLineSymbol(
CartographicLineSymbol.STYLE_SOLID,
new Color([255,0,0]), 10,
CartographicLineSymbol.CAP_ROUND,
CartographicLineSymbol.JOIN_MITER, 5
);
// fill symbol used for extent, polygon and freehand polygon, use a picture fill symbol
// the images folder contains additional fill images, other options: sand.png, swamp.png or stiple.png
var fillSymbol = new PictureFillSymbol(
"images/mangrove.png",
new SimpleLineSymbol(
SimpleLineSymbol.STYLE_SOLID,
new Color('#000'),
1
),
42,
42
);
function initToolbar() {
tb = new Draw(map);
tb.on("draw-end", addGraphic);
// event delegation so a click handler is not
// needed for each individual button
on(dom.byId("info"), "click", function(evt) {
if ( evt.target.id === "info" ) {
return;
}
var tool = evt.target.id.toLowerCase();
map.disableMapNavigation();
tb.activate(tool);
});
}
function addGraphic(evt) {
//deactivate the toolbar and clear existing graphics
tb.deactivate();
map.enableMapNavigation();
// figure out which symbol to use
var symbol;
if ( evt.geometry.type === "point" || evt.geometry.type === "multipoint") {
symbol = markerSymbol;
} else if ( evt.geometry.type === "line" || evt.geometry.type === "polyline") {
symbol = lineSymbol;
}
else {
symbol = fillSymbol;
}
map.graphics.add(new Graphic(evt.geometry, symbol));
}
});
</script> After deletion this is what I have left. Doing so removed the MapDiv creation reference in the HTML
<script>
var map, tb;
require([
"esri/map", "esri/toolbars/draw", "esri/arcgis/utils",
"esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol",
"esri/symbols/PictureFillSymbol", "esri/symbols/CartographicLineSymbol",
"esri/graphic",
"dojo/_base/Color", "dojo/dom", "dojo/on", "dojo/domReady!"
], function(
Map, Draw, arcgisUtils,
SimpleMarkerSymbol, SimpleLineSymbol,
PictureFillSymbol, CartographicLineSymbol,
Graphic, Color, dom, on
) {
arcgisUtils.createMap("7f843bb0a37849f68a5a2cc3d2b06288", "mapDiv").then(function (response) {
map = response.map;
});
map.on("load", initToolbar);
// markerSymbol is used for point and multipoint, see http://raphaeljs.com/icons/#talkq for more examples
var markerSymbol = new SimpleMarkerSymbol();
markerSymbol.setPath("M16,4.938c-7.732,0-14,4.701-14,10.5c0,1.981,0.741,3.833,2.016,5.414L2,25.272l5.613-1.44c2.339,1.316,5.237,2.106,8.387,2.106c7.732,0,14-4.701,14-10.5S23.732,4.938,16,4.938zM16.868,21.375h-1.969v-1.889h1.969V21.375zM16.772,18.094h-1.777l-0.176-8.083h2.113L16.772,18.094z");
markerSymbol.setColor(new Color("#00FFFF"));
// lineSymbol used for freehand polyline, polyline and line.
var lineSymbol = new CartographicLineSymbol(
CartographicLineSymbol.STYLE_SOLID,
new Color([255,0,0]), 10,
CartographicLineSymbol.CAP_ROUND,
CartographicLineSymbol.JOIN_MITER, 5
);
// fill symbol used for extent, polygon and freehand polygon, use a picture fill symbol
// the images folder contains additional fill images, other options: sand.png, swamp.png or stiple.png
var fillSymbol = new PictureFillSymbol(
"images/mangrove.png",
new SimpleLineSymbol(
SimpleLineSymbol.STYLE_SOLID,
new Color('#000'),
1
),
42,
42
);
function initToolbar() {
tb = new Draw(map);
tb.on("draw-end", addGraphic);
// event delegation so a click handler is not
// needed for each individual button
on(dom.byId("info"), "click", function(evt) {
if ( evt.target.id === "info" ) {
return;
}
var tool = evt.target.id.toLowerCase();
map.disableMapNavigation();
tb.activate(tool);
});
}
function addGraphic(evt) {
//deactivate the toolbar and clear existing graphics
tb.deactivate();
map.enableMapNavigation();
// figure out which symbol to use
var symbol;
if ( evt.geometry.type === "point" || evt.geometry.type === "multipoint") {
symbol = markerSymbol;
} else if ( evt.geometry.type === "line" || evt.geometry.type === "polyline") {
symbol = lineSymbol;
}
else {
symbol = fillSymbol;
}
map.graphics.add(new Graphic(evt.geometry, symbol));
}
});
</script> <div id="mapDiv"> </div>
... View more
01-23-2014
08:36 AM
|
0
|
0
|
480
|
|
POST
|
From examples I am trying to add this to the code below:
arcgisUtils.createMap("7f843bb0a37849f68a5a2cc3d2b06288", "mapDiv").then(function (response) {
map = response.map;
}); Nothing shows up...its sort of a combination of two examples....just want to add data from a WebMap and from a REST enpoint...anyone know what I am doing wrong?
...SNIP
var map, tb;
require([
"esri/map", "esri/toolbars/draw", "esri/arcgis/utils",
"esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol",
"esri/symbols/PictureFillSymbol", "esri/symbols/CartographicLineSymbol",
"esri/graphic",
"dojo/_base/Color", "dojo/dom", "dojo/on", "dojo/domReady!"
], function(
Map, Draw, arcgisUtils,
SimpleMarkerSymbol, SimpleLineSymbol,
PictureFillSymbol, CartographicLineSymbol,
Graphic, Color, dom, on
) {
arcgisUtils.createMap("7f843bb0a37849f68a5a2cc3d2b06288", "mapDiv").then(function (response) {
map = response.map;
});
map = new Map("mapDiv", {
basemap: "topo",
center: [-77.4329, 37.5410],
zoom: 7,
slider: true
});
map.on("load", initToolbar);
...SNIP
... View more
01-23-2014
08:19 AM
|
0
|
3
|
968
|
|
POST
|
Got it Jon...thanks tried Localhost and it defaulted to an html page inside the folder... but went into the Default Document in IIS and that specific html page was top of the list in the defaults Also noticed that the two websites I created all were using the default port 80.... I changed the ports to 81 and 82 and then did a localhost:81 and the file set for default displayed... I then did localhost:81/webmapping.html and the page came up fine... Maps and the geocoder examples are working from the examples the way they should....I think I am good to go.... Thank you all for your thoughts and comments throughout this post.....VERY appreciated.
... View more
01-21-2014
02:46 PM
|
0
|
0
|
1478
|
|
POST
|
trying to get there with this: get the error see attached.....maybe because I dont have win8 pro IIS is not running as a server? I dont know thoughts [ATTACH=CONFIG]30679[/ATTACH] http://localhost/JavaScriptApplication/index.html [ATTACH=CONFIG]30680[/ATTACH]
... View more
01-21-2014
12:41 PM
|
0
|
0
|
2660
|
|
POST
|
Tell you the truth I dont remember....I cannot test right now but will do so later...Thanks for your suggestion. Cheers.
... View more
01-21-2014
08:16 AM
|
0
|
0
|
2660
|
|
POST
|
i can get to it from your URL but when I run from here.....as seen below code....I get this in the console error on WebMap It has to be something with IIS....maybe the IIS that comes with Win8 is not able to get out or wont get to that URL??? I am lost here... Tried the Geocoder example from API examples and it just spins endlessly when I submit an address. I get this error with the Geocoder Example ERROR Geocoder example https://developers.arcgis.com/en/javascript/jssamples/locator_simple.html MLHttpRequest cannot load http://services.arcgisonline.com/ArcGIS/rest/info?f=json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. ERROR FOR WebMap: OPTIONS file://www.arcgis.com/sharing/rest/content/items/7f843bb0a37849f68a5a2cc3d2b06288?f=json init.js:158 r {stack: "Error: Unable to load file://www.arcgis.com/sharin�?�uest.h (http://js.arcgis.com/3.8/init.js:160:167)", message: "Unable to load file://www.arcgis.com/sharing/rest/�?�7f843bb0a37849f68a5a2cc3d2b06288?f=json status: 0", response: Object, status: 0, responseText: ""�?�} _ssl: undefined log: undefined message: "Unable to load file://www.arcgis.com/sharing/rest/content/items/7f843bb0a37849f68a5a2cc3d2b06288?f=json status: 0" response: Object responseText: "" stack: "Error: Unable to load file://www.arcgis.com/sharing/rest/content/items/7f843bb0a37849f68a5a2cc3d2b06288?f=json status: 0�?� at Error (native)�?� at new r (http://js.arcgis.com/3.8/init.js:221:367)�?� at XMLHttpRequest.h (http://js.arcgis.com/3.8/init.js:160:167)" status: 0 xhr: XMLHttpRequest __proto__: a <script>
require([
"esri/map",
"esri/arcgis/utils",
"dojo/domReady!"
], function(Map, arcgisUtils){
arcgisUtils.createMap("7f843bb0a37849f68a5a2cc3d2b06288", "mapDiv").then(function (response) {
map = response.map;
});
});
</script>
... View more
01-18-2014
12:16 PM
|
0
|
0
|
2660
|
|
POST
|
I don't know why the url gets truncated on my latest post but the correct one is: www.arcgis.com/sharing/rest/content/items/7f843bb0a37849f68a5a2cc3d2b06288?f=json Can you access successfully? If I cut and paste into URL I get this {"id" : "7f843bb0a37849f68a5a2cc3d2b06288","owner" : "jay.kapalczynski","created" : 1390042038000,"modified" : 1390069539000,"guid" : null,"name" : null,"title" : "TESTING","type" : "Web Map","typeKeywords" : ["ArcGIS Online", "Explorer Web Map", "Map", "Online Map", "Web Map"],"description" : null,"tags" : ["TESTING", "JAYSTESTING"],"snippet" : null,"thumbnail" : "thumbnail/ago_downloaded.png","documentation" : null,"extent" : [[-83.0815, 33.6994], [-75.4131, 41.156]],"spatialReference" : null,"accessInformation" : null,"licenseInfo" : null,"culture" : "en-us","properties" : null,"url" : null,"access" : "public","size" : 446,"appCategories" : [],"industries" : [],"languages" : [],"largeThumbnail" : null,"banner" : null,"screenshots" : [],"listed" : false,"commentsEnabled" : true,"numComments" : 0,"numRatings" : 0,"avgRating" : 0.0,"numViews" : 26}
... View more
01-18-2014
12:07 PM
|
0
|
0
|
2660
|
|
POST
|
I can access that new Fiddle you created fine I am trying to access that URL when I click it I get this in the browsers URL http://www.arcgis.com/sharing/rest/%E2%80%A67f843bb0a37849f68a5a2cc3d2b06288?f=json When I navigate there I get this error {"error":{"code":400,"messageCode":"GWM_0002","message":"Invalid URL","details":[]}} click to see image: [ATTACH=CONFIG]30620[/ATTACH] Note I am using my Laptop and WiFi...just local I am running Win8 64 Bit using Chrome Version 32.0.1700.76 m Using IIS Version 8.09200.16384 I simply activated IIS on my computer....Maybe because I dont have win8 professional or something that IIS is not the correct version? Win8 I have allowed my to go in and turn on IIS so I assume that it shoudl work. THIS WORKS:
<script>
var map;
require(["esri/map", "dojo/domReady!"
], function(Map) {
map = new Map("mapDiv", {
center: [-77.4329, 37.5410],
zoom: 6,
basemap: "streets"
});
});
</script>
THIS DOES NOT:
<script>
require([
"esri/map",
"esri/arcgis/utils",
"dojo/domReady!"
], function(Map, arcgisUtils){
arcgisUtils.createMap("1a40fa5cc1ab4569b79f45444d728067", "mapDiv").then(function (response) {
map = response.map;
});
});
</script>
... View more
01-18-2014
08:57 AM
|
0
|
0
|
2660
|
|
POST
|
Yea I tried your example EXACTLY....it works in Fiddle but not when I placed it in my IIS website. Could there be something in IIS thats not letting me get there? I used the map ID that you did in your Fiddle examples....that should work right? Does not on my side Am I not getting the correct ID to you? Where exactly do I get it from....after I open it from within ArcGIS online org account? When I try those ids I dont even get to where you are asking for a login Do I have to have an editable Feature in the web map? It should work with simply the basemap right> Yes I shared it [ATTACH=CONFIG]30619[/ATTACH] Do you have an ID that works that I can test in my html code? I have not idea whats going on.... This is my Whole page....all the code I am using
<!DOCTYPE html>
<html>
<head>
<title>Create a Web Map</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" type="text/css" href="http://js.arcgis.com/3.8/js/esri/css/esri.css">
<style>
html,body,#mapDiv,.map.container{
padding:0;
margin:0;
height:100%;
}
</style>
<script>var dojoConfig = { parseOnLoad:true };</script>
<script src="http://js.arcgis.com/3.8compact/"></script>
<script>
require([
"esri/map",
"esri/arcgis/utils",
"dojo/domReady!"
], function(Map, arcgisUtils){
arcgisUtils.createMap("1a40fa5cc1ab4569b79f45444d728067", "mapDiv").then(function (response) {
map = response.map;
});
});
</script>
</head>
<body>
<div id="mapDiv"></div>
</body>
</html>
... View more
01-18-2014
08:03 AM
|
0
|
0
|
3514
|
|
POST
|
Getting the below in the Javascript console OPTIONS file://www.arcgis.com/sharing/rest/content/items/7f843bb0a37849f68a5a2cc3d2b06288?f=json init.js:158 r {stack: "Error: Unable to load file://www.arcgis.com/sharin�?�(http://js.arcgis.com/3.8compact/init.js:160:167)", message: "Unable to load file://www.arcgis.com/sharing/rest/�?�7f843bb0a37849f68a5a2cc3d2b06288?f=json status: 0", response: Object, status: 0, responseText: ""�?�} _ssl: undefined log: undefined message: "Unable to load file://www.arcgis.com/sharing/rest/content/items/7f843bb0a37849f68a5a2cc3d2b06288?f=json status: 0" response: Object responseText: "" stack: "Error: Unable to load file://www.arcgis.com/sharing/rest/content/items/7f843bb0a37849f68a5a2cc3d2b06288?f=json status: 0�?� at Error (native)�?� at new r (http://js.arcgis.com/3.8compact/init.js:221:367)�?� at XMLHttpRequest.h (http://js.arcgis.com/3.8compact/init.js:160:167)" status: 0 xhr: XMLHttpRequest __proto__: a init.js:187 w init.js:187 (anonymous function) init.js:186 c init.js:74 d init.js:74 resolve.callback init.js:75 c init.js:74 d init.js:74 reject.errback init.js:76 c init.js:74 d init.js:74 reject.errback init.js:76 c init.js:74 d init.js:74 reject.errback init.js:76 (anonymous function) init.js:190 f init.js:194 q init.js:194 w.reject init.js:197 a init.js:195 f init.js:195 q init.js:194 w.reject init.js:197 a init.js:195 f init.js:195 q init.js:194 w.reject init.js:197 a init.js:195 f init.js:195 q init.js:194 w.reject init.js:197 a init.js:195 f init.js:195 q init.js:194 w.reject init.js:197 r init.js:156 h
... View more
01-18-2014
07:14 AM
|
0
|
0
|
3514
|
|
POST
|
Thanks 1. I tried to grab your code and placed that in a new html page and it does not work....thats confusing 2. I went into my Organization account and set up a web map with simply basemanp. Shared it to public id=7f843bb0a37849f68a5a2cc3d2b06288 http://dgif-virginia.maps.arcgis.com/home/item.html?id=7f843bb0a37849f68a5a2cc3d2b06288 I assume this is the ID I need? If not where do I get it? Or this one once I open the web map webmap=7f843bb0a37849f68a5a2cc3d2b06288 http://dgif-virginia.maps.arcgis.com/home/webmap/viewer.html?webmap=7f843bb0a37849f68a5a2cc3d2b06288
... View more
01-18-2014
06:52 AM
|
0
|
0
|
3514
|
|
POST
|
I have Fiddler2 installed..... # Result Protocol Host URL Body Caching Content-Type Process Comments Custom 1 200 HTTP fiddler2.com /UpdateCheck.aspx?isBeta=False 595 private text/plain; charset=utf-8 fiddler:2824 2 302 HTTP js.arcgis.com /3.8compact/ 0 chrome:4952 HOw do I use the Java Script console....new at this sorry...but trying It gets to here and stops...Funning thing is...I created a new HTML file and pasted the code thats in your example and still nothing....exactly what you had in there. Confused. THANK YOU VERY MUCH EDIT: If I dont set to public is there a widget I need to add to prompt the user for a password that would be set in my Organization Account, or does this automatically happen when trying to access a secured feature?
... View more
01-18-2014
06:12 AM
|
0
|
0
|
3514
|
|
POST
|
I have an ArcGIS online app running...this is the URL I can use to paste into a browser and it displays fine. NOTE: I changed the appid below....this is the ID I am trying to use in my Java Script app and its not working This wont work as is...I shared the Web Map Application to Public as I changed it aroudn a bit...must using it for reference http://maps.arcgis.com/apps/OnePane/basicviewer/index.html?appid=240ssf435dfgfgdgdgfdc02386aebbae <script>
var map;
require(["esri/map", "esri/arcgis/utils", "esri/dijit/Legend", "dojo/domReady!"
], function(Map, arcgisUtils, Legend) {
arcgisUtils.createMap("240ssf435dfgfgdgdgfdc02386aebbae", "mapDiv").then(function (response) {
map = response.map;
var legend = new Legend({
map: map,
layerInfos:(arcgisUtils.getLegendLayers(response))
}, "legendDiv");
legend.startup();
});
});
</script>
... View more
01-18-2014
05:56 AM
|
0
|
0
|
3514
|
|
POST
|
I am running through some tutorials and having an issue https://developers.arcgis.com/en/javascript/jstutorials/intro_agstemplate_amd.html I am trying to use the Web Map Id they said you can in the example and then the map vanishes. I dont know how to get another one I can use. I assume that the web map id is not working....what else can I be doing wrong If you haven't created a web map yet, you can use 1a40fa5cc1ab4569b79f45444d728067 for testing. require([ "esri/map", "esri/arcgis/utils", "dojo/domReady!" ], function(Map, arcgisUtils){ arcgisUtils.createMap("1a40fa5cc1ab4569b79f45444d728067", "mapDiv").then(function (response) { map = response.map; }); }); If I use this from the first example then the map shows up fine map = new Map("mapDiv", { center: [-77.4329, 37.5410], zoom: 6, basemap: "streets" <script> var map; require(["esri/map", "esri/arcgis/utils", "esri/dijit/Legend", "dojo/domReady!" ], function(Map, arcgisUtils, Legend ) { arcgisUtils.createMap("1a40fa5cc1ab4569b79f45444d728067", "mapDiv").then(function (response) { map = response.map; var legend = new Legend({ map: map, layerInfos:(arcgisUtils.getLegendLayers(response)) }, "legendDiv"); legend.startup(); }); }); </script>
... View more
01-18-2014
05:24 AM
|
0
|
30
|
11534
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-20-2018 11:09 AM | |
| 1 | 09-10-2018 06:26 AM | |
| 1 | 09-15-2022 11:02 AM | |
| 1 | 05-21-2021 07:35 AM | |
| 1 | 08-09-2022 12:39 PM |
| Online Status |
Offline
|
| Date Last Visited |
09-19-2022
09:23 PM
|