POST
|
I am using ArcGIS API for JS 3.14 and I would like to present the selected Marker with this symbol: currently I am getting all markers surrounded with simple Square like the left side clicked in below image Can you please let me know where to set this?
... View more
09-04-2015
12:42 AM
|
0
|
2
|
2045
|
POST
|
Thanks a lot Jeremie, it was very helpful. Can you please also let me know how I can change the highlight box around the marker on click to something like Target sign, as well?
... View more
09-03-2015
11:38 PM
|
0
|
1
|
628
|
POST
|
I am trying to hide a layer on the map like var point = new esri.geometry.Point(-106.61, 35.1107);
point = esri.geometry.geographicToWebMercator(point);
var symbol = new esri.symbol.PictureMarkerSymbol("https://cdn1.iconfinder.com/data/icons/Map-Markers-Icons-Demo-PNG/128/Map-Marker-Marker-Outside-Chartreuse.png", 32, 32);
pointInfoTemplate = new InfoTemplate();
pointInfoTemplate.setTitle("Project Details");
pointInfoTemplate.setContent('<div>Some Att Here</div> ');
var graphic = new esri.Graphic(point, symbol).setInfoTemplate(pointInfoTemplate);
layer1 = new esri.layers.GraphicsLayer();
layer1.add(graphic);
map.addLayer(layer1);
$("#hide").on("click", function(){
layer1.hide();
}); which works fine but the `InfoTemplate()` remains in the map (in case of it being opened)
... View more
09-03-2015
11:18 PM
|
0
|
3
|
3277
|
POST
|
For what ever reason part of code in points pointInfoTemplate.setTitle("Project Details"); pointInfoTemplate.setContent('<div class="list-group marker-info"> <a href="#" class="list-group-item"><div class="row"><span class="col-md-7 marker-info-txt">Project</span><span class="col-md-3 marker-info-txt"><strong>'+project.ProjectID+'</strong></span></div></a> <a href="#" class="list-group-item"><div class="row"><span class="col-md-7 marker-info-txt">Road Length</span><span class="col-md-3 marker-info-txt"><strong>'+project.RoadLength+'</strong></span></div></a> <a href="#" class="list-group-item"><div class="row"><span class="col-md-7 marker-info-txt">Powerline Length</span><span class="col-md-3 marker-info-txt"><strong>'+project.PowerLineLength+'</strong></span></div></a> <a href="#" class="list-group-item"><div class="row"><span class="col-md-7 marker-info-txt">Penstock</span><span class="col-md-3 marker-info-txt"><strong>'+project.Penstock+'</strong></span></div></a> <a href="#" class="list-group-item"><div class="row"><span class="col-md-7 marker-info-txt">Installed Capacity</span><span class="col-md-3 marker-info-txt"><strong>'+project.InstalledCapacity+'</strong></span></div></a><a href="#" class="list-group-item"><div class="row"><span class="col-md-7 marker-info-txt">Annual Firm Energy</span><span class="col-md-3 marker-info-txt"><strong>'+project.AnnualFirmEnergy+'</strong></span></div></a><a href="#" class="list-group-item"><div class="row"><span class="col-md-7 marker-info-txt">Cost Of Energy</span><span class="col-md-3 marker-info-txt"><strong>'+project.CostOfEnergy+'</strong></span></div></a><a href="#" class="list-group-item"><div class="row"><span class="col-md-7 marker-info-txt">Footprint</span><span class="col-md-3 marker-info-txt"><strong>'+project.Footprint+'</strong></span></div></a><a href="#" class="list-group-item"><div class="row"><span class="col-md-7 marker-info-txt">Cost Per Year</span><span class="col-md-3 marker-info-txt"><strong>'+project.CostPerYear+'</strong></span></div></a></div> '); is not showing in above post! Please check the full code in attached file?
... View more
09-02-2015
09:47 AM
|
0
|
0
|
482
|
POST
|
I have two functions ` createPoints(); and addClusters(); to create points and cluster points from JSON point values and I am switching the map presentation (Points<-->Cluster) by suing a Chechbox like : if($("input[type='checkbox'][name='clusterPoints']").is(':checked')) {
createPoints();
}else{ addClusters();}
$("input[type='checkbox'][name='clusterPoints']").change(function(){
if($(this).is(':checked')){
map.removeLayer(clusterLayer);
map.graphics.show();
}
else{
map.graphics.hide();
addClusters();
}
}); now after switching from Cluster to Points, I am missing the points InfoTemplate(); (not poping up on points on click) but the Cluster PopupTemplate(s) work fine . Here is the how code: function createPoints(){
for (var i = 0; i < mapInfo.length; i++) {
var project = mapInfo;
var point = new Point(project.Longitude, project.Latitude);
var pointSymbol = new SimpleMarkerSymbol();
pointSymbol.setStyle(SimpleMarkerSymbol.STYLE_CIRCLE);
pointSymbol.setSize(12);
var pointInfoTemplate = new InfoTemplate();
pointInfoTemplate.setTitle("Project Details");
pointInfoTemplate.setContent('<div class="list-group marker-info"> <a href="#" class="list-group-item"><div class="row"><span class="col-md-7 marker-info-txt">Project</span><span class="col-md-3 marker-info-txt"><strong>'+project.ProjectID+'</strong></span></div></a> <a href="#" class="list-group-item"><div class="row"><span class="col-md-7 marker-info-txt">Road Length</span><span class="col-md-3 marker-info-txt"><strong>'+project.RoadLength+'</strong></span></div></a> <a href="#" class="list-group-item"><div class="row"><span class="col-md-7 marker-info-txt">Powerline Length</span><span class="col-md-3 marker-info-txt"><strong>'+project.PowerLineLength+'</strong></span></div></a> <a href="#" class="list-group-item"><div class="row"><span class="col-md-7 marker-info-txt">Penstock</span><span class="col-md-3 marker-info-txt"><strong>'+project.Penstock+'</strong></span></div></a> <a href="#" class="list-group-item"><div class="row"><span class="col-md-7 marker-info-txt">Installed Capacity</span><span class="col-md-3 marker-info-txt"><strong>'+project.InstalledCapacity+'</strong></span></div></a><a href="#" class="list-group-item"><div class="row"><span class="col-md-7 marker-info-txt">Annual Firm Energy</span><span class="col-md-3 marker-info-txt"><strong>'+project.AnnualFirmEnergy+'</strong></span></div></a><a href="#" class="list-group-item"><div class="row"><span class="col-md-7 marker-info-txt">Cost Of Energy</span><span class="col-md-3 marker-info-txt"><strong>'+project.CostOfEnergy+'</strong></span></div></a><a href="#" class="list-group-item"><div class="row"><span class="col-md-7 marker-info-txt">Footprint</span><span class="col-md-3 marker-info-txt"><strong>'+project.Footprint+'</strong></span></div></a><a href="#" class="list-group-item"><div class="row"><span class="col-md-7 marker-info-txt">Cost Per Year</span><span class="col-md-3 marker-info-txt"><strong>'+project.CostPerYear+'</strong></span></div></a></div> ');
var pointGraphic = new Graphic(point, pointSymbol).setInfoTemplate(pointInfoTemplate);
points.push(pointGraphic);
}
for (i = 0; i < points.length; ++i) {
map.graphics.add(points);
}
}
function addClusters() {
var project=[];
for (var i = 0; i < mapInfo.length; i++) {
project.push(mapInfo);
}
var photoInfo = [];
var wgs = new SpatialReference({
"wkid": 4326
});
photoInfo.data = arrayUtils.map(mapInfo, function(p) {
var latlng = new Point(parseFloat(p.Longitude), parseFloat(p.Latitude), wgs);
var webMercator = webMercatorUtils.geographicToWebMercator(latlng);
var attributes = {
"Project ID": p.ProjectID,
"Road Length": p.RoadLength,
"Powerline Length": p.PowerLineLength,
"Penstock": p.Penstock,
"Installed Capacity": p.InstalledCapacity,
"Annual Firm Energy": p.AnnualFirmEnergy,
"Cost Of Energy": p.CostOfEnergy,
"Footprint": p.Footprint,
"Cost Per Year": p.CostPerYear,
};
return {
"x": webMercator.x,
"y": webMercator.y,
"attributes": attributes
};
});
var popupTemplate = new PopupTemplate({
"title": "Project Details",
"fieldInfos": [{
"fieldName": "Project ID",
visible: true
}, {
"fieldName": "Road Length",
visible: true
}, {
"fieldName": "Powerline Length",
visible: true
},
{
"fieldName": "Penstock",
visible: true
},
{
"fieldName": "Installed Capacity",
visible: true
},
{
"fieldName": "Annual Firm Energy",
visible: true
},
{
"fieldName": "Cost Of Energy",
visible: true
},
{
"fieldName": "Footprint",
visible: true
},
{
"fieldName": "Cost Per Year",
visible: true
}],
"mediaInfos": [{
"title": "",
"caption": "",
"type": "image",
"value": {
"sourceURL": "{Image}",
"linkURL": "{Link}"
}
}]
});
clusterLayer = new ClusterLayer({
"data": photoInfo.data,
"distance": 100,
"id": "clusters",
"labelColor": "#fff",
"labelOffset": 10,
"resolution": map.extent.getWidth() / map.width,
"singleColor": "#888",
"singleTemplate": popupTemplate
});
var defaultSym = new SimpleMarkerSymbol().setSize(4);
var renderer = new ClassBreaksRenderer(defaultSym, "clusterCount");
var picBaseUrl = "http://static.arcgis.com/images/Symbols/Shapes/";
var blue = new PictureMarkerSymbol(picBaseUrl + "BluePin1LargeB.png", 32, 32).setOffset(0, 15);
var green = new PictureMarkerSymbol(picBaseUrl + "GreenPin1LargeB.png", 64, 64).setOffset(0, 15);
var red = new PictureMarkerSymbol(picBaseUrl + "RedPin1LargeB.png", 72, 72).setOffset(0, 15);
renderer.addBreak(0, 2, blue);
renderer.addBreak(2, 200, green);
renderer.addBreak(200, 1001, red);
clusterLayer.setRenderer(renderer);
map.addLayer(clusterLayer);
// close the info window when the map is clicked
map.on("click", cleanUp);
// close the info window when esc is pressed
map.on("key-down", function(e) {
if (e.keyCode === 27) {
cleanUp();
}
});
function cleanUp() {
map.infoWindow.hide();
clusterLayer.clearSingles();
}
function error(err) {
console.log("something failed: ", err);
}
window.showExtents = function() {
var extents = map.getLayer("clusterExtents");
if ( extents ) {
map.removeLayer(extents);
}
extents = new GraphicsLayer({ id: "clusterExtents" });
var sym = new SimpleFillSymbol().setColor(new Color([205, 193, 197, 0.5]));
arrayUtils.forEach(clusterLayer._clusters, function(c, idx) {
var e = c.attributes.extent;
extents.add(new Graphic(new Extent(e[0], e[1], e[2], e[3], map.spatialReference), sym));
}, this);
map.addLayer(extents, 0);
};
}
if($("input[type='checkbox'][name='clusterPoints']").is(':checked')) {
createPoints();
}else{ addClusters();}
$("input[type='checkbox'][name='clusterPoints']").change(function(){
if($(this).is(':checked')){
map.removeLayer(clusterLayer);
map.graphics.show();
}
else{
map.graphics.hide();
addClusters();
}
}); Can you please let me know why this is happening and how I can fix this? Am using correct functions ` map.graphics.hide();` and map.removeLayer(clusterLayer); to clear map for next presentation in check box switch?
... View more
09-02-2015
09:45 AM
|
0
|
1
|
2752
|
POST
|
I am following this tutorial to create some Cluster Points. the result is look like : Can you please let me know how I can update the Markers to custom images or SVG? Thanks
... View more
09-02-2015
12:54 AM
|
0
|
2
|
3468
|
POST
|
Can you please take a look at This Demo and let me know how I can set up a custom home button var map;
require(["esri/map", "esri/geometry/Point",
"esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol",
"esri/graphic", "dojo/dom","dojo/on", "dojo/domReady!"], function (Map, Point,
SimpleMarkerSymbol, SimpleLineSymbol,
Graphic, dom, on) {
map = new Map("map", {
center: [0, 0],
zoom: 5,
basemap: "topo",
slider: false, // set to false to remove default zoom buttons
spatialReference: { wkid: 4326 }
});
on(dom.byId("zoomInBtn"), "click", function(evt){map.setZoom(map.getZoom()+1);});
on(dom.byId("zoomOutBtn"), "click", function(evt){map.setZoom(map.getZoom()-1);});
on(dom.byId("goHome"), "click", function(evt){});
});
... View more
09-02-2015
12:13 AM
|
0
|
2
|
4022
|
POST
|
ArcGIS API is using This Demo to illustrate how Point clustering works with JSON data. In my case I am generating some point graphics from MySQL Database by a jQuery AJAX request like following code: As you can see I am storing the data in `project` and then access to `project.Longitude, project.Latitude` to create the points request.done(function( mapInfo) {
for (var i = 0; i < mapInfo.length; i++) {
var project = mapInfo;
var point = new Point(project.Longitude, project.Latitude);
var pointSymbol = new SimpleMarkerSymbol();
pointSymbol.setStyle(SimpleMarkerSymbol.STYLE_CIRCLE);
pointSymbol.setSize(12);
var pointInfoTemplate = new InfoTemplate();
pointInfoTemplate.setTitle("Project Details");
pointInfoTemplate.setContent('//JSON Data');
var pointGraphic = new Graphic(point, pointSymbol).setInfoTemplate(pointInfoTemplate);
points.push(pointGraphic);
}
for (i = 0; i < points.length; ++i) {
map.graphics.add(points);
}
});` Can you please let me know how I can bind this points with Cluster Points in ArcGIS API sample? Thanks
... View more
08-27-2015
01:45 AM
|
0
|
0
|
2710
|
POST
|
Can you please let me know if it is possible to bind our custom DOM into the geometry point instead of ArcGIS API SimpleMarkerSymbol()? I tried to do this like this var point = new Point(-126.687482, 54.793577);
var pointSymbol = '<div class="marker"></div>'; but it is not doing the job! here is the whole code ar point = new Point(-126.687482, 54.793577);
var pointSymbol = '<div class="marker"></div>';
var pointAttributes = {city: "Albuquerque", state: "New Mexico"};
var pointInfoTemplate = new InfoTemplate("Albuquerque");
var pointGraphic = new Graphic(point, pointSymbol, pointAttributes).setInfoTemplate(pointInfoTemplate);
thePoints.push(pointGraphic);
console.log(thePoints)
map.on('load', function () {
for (i = 0; i < thePoints.length; ++i) {
map.graphics.add(thePoints);
}
});
... View more
08-26-2015
11:28 AM
|
0
|
0
|
2203
|
POST
|
Can you please take a look at this JSFiddle and let me know why I am not able to add the Market into the Map? I am getting this error Uncaught TypeError: Cannot read property 'add' of null Here is the ode I have
var graphicsArray = [];
require(["esri/map",
"esri/geometry/Geometry",
"esri/geometry/Point",
"esri/geometry/Polyline",
"esri/geometry/Polygon",
"esri/graphic",
"esri/symbols/SimpleMarkerSymbol",
"esri/symbols/SimpleLineSymbol",
"esri/symbols/SimpleFillSymbol",
"esri/Color",
"esri/InfoTemplate",
"dojo/domReady!",
"esri/geometry"], function (Map,
Geometry,
Point,
Polyline,
Polygon,
Graphic,
SimpleMarkerSymbol,
SimpleLineSymbol,
SimpleFillSymbol,
Color,
InfoTemplate) {
map = new Map("map", {
basemap: "topo",
center: [-106.61, 35.1107],
zoom: 13
});
var point = new Point(-106.61, 35.1107);
var pointSymbol = new SimpleMarkerSymbol();
var pointAttributes = { city: "Albuquerque", state: "New Mexico" };
var pointInfoTemplate = new InfoTemplate("Albuquerque");
var pointGraphic = new Graphic(point, pointSymbol, pointAttributes).setInfoTemplate(pointInfoTemplate);
graphicsArray.push(pointGraphic);
for (i = 0; i < graphicsArray.length; ++i) {
map.graphics.add(graphicsArray);
}
});
html, body, #map {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
body {
background-color: #FFF;
overflow: hidden;
font-family:"Trebuchet MS";
} <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="http://js.arcgis.com/3.14/esri/css/esri.css">
<script src="http://js.arcgis.com/3.14/"></script>
<div id="map"></div> [1]: http://jsfiddle.net/Behseini/ady51wrn/
... View more
08-26-2015
01:24 AM
|
0
|
2
|
2891
|
POST
|
Can you please let me know if it is possible to update ArcGIS API Basemap by using jQuery. I am looking for a hack to bind updating of a array to update the basemap option in the map object Here is what I have tried <select id="base-map-options">
<option value="0">Imagery</option>
<option value="1">Topographic With Lable</option>
</select>
var map;
var basemap = ['topo','streets','imagarey']
require([ "esri/map",
"esri/layers/ArcGISDynamicMapServiceLayer",
"dojo/domReady!" ],
function(Map) { map = new Map("mapDiv", {
center: [-126.687482, 54.793577],
zoom: 5,
basemap: basemap[0]
});
$("#base-map-options").on("change", function () {
basemap[$('option:selected').val()];
});
}); as you can see I am trying to update selected index in basemap[] through $("#base-map-options").on("change", function () {
basemap[$('option:selected').val()];
}); but I don't know how to bind this to basemap property of the map object? thanks
... View more
08-25-2015
01:15 PM
|
0
|
0
|
2591
|
POST
|
Using ArcGIS Server 10.2.2 on Windows Server 2012 R2 I am having problem on configuring ArcGIS Web Adapter. Here is what I have done: 1- I entered 'http://localhost:6080` in GIS Server URl box and used the same Administrator User Name and Password into the box (the ones which I used to create the server) but in result I am getting this error 2- In second try I used http://gisserver.mapapp:6080 which the mapapp is the name of machine running the server with same credential but now I am getting this error Can you please let me know what I am doing wrong?
... View more
08-24-2015
05:04 PM
|
0
|
2
|
3366
|
POST
|
I tried both this methods import arcpy from arcpy import env env.workspace = "E:\\GIS\\Data" inFeature = "band-tailed_pigeon.shp" outFeature = "E:\\GIS\\Data\\band-tailed_pigeon-NOZM.shp" env.outputZFlag = "Disabled" env.outputMFlag = "Disabled" arcpy.FeatureClassToFeatureClass_conversion(inFeature, outFeature) import arcpy from arcpy import env env.workspace = "E:\\GIS\\Data" inFeature = "band-tailed_pigeon.shp" outFeature = "band-tailed_pigeon-NOZM.shp" env.outputZFlag = "Disabled" env.outputMFlag = "Disabled" arcpy.FeatureClassToFeatureClass_conversion(inFeature, outFeature) but I am getting this error in both case FeatureClassToFeatureClass C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\conversion.py 1675 ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Output Location: Dataset E:\GIS\Data\band-tailed_pigeon-NOZM.shp does not exist or is not supported ERROR 000735: Output Feature Class: Value is required Failed to execute (FeatureClassToFeatureClass). Can you please let me know what I am doing wrong?
... View more
08-20-2015
04:37 AM
|
0
|
2
|
1954
|
Title | Kudos | Posted |
---|---|---|
1 | 03-07-2011 02:23 PM | |
1 | 09-02-2015 12:50 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|