POST
|
Thanks Jeff. I did have Popup and PopupTemplate reversed in the function call. I corrected this but nothing seems to have changed. My issue is still this... in the location below there are 12 coincident features. With the map.onlick event that I defined to select features within 40 pixels of the map click, I can get all the features in to the popup. [ATTACH=CONFIG]29765[/ATTACH] But this ONLY works if I click NEAR the graphic. If I click on the feature layer graphic, I can only get one of those features in to the popup, despite there actually being 12 features stacked there. This makes it seem that there is only a single feature there. [ATTACH=CONFIG]29766[/ATTACH] I want to get all 12 features into the popup whether I click near or on the graphic...
... View more
12-11-2013
05:21 AM
|
0
|
0
|
1195
|
POST
|
Thanks for the response Jason. You're right, I do have several events doing the same thing... I kept adding event handlers to try to get it to work and they aren't all needed. However, InfoTemplate on its own will only return a single feature for me, even in a scenario where several points are coincident. So I either need to change the InfoTemplate behaviour so that it can return multiple features or disable it and allow only my select by location to fire whenever the map is clicked. Haven't had luck doing either of these yet...
... View more
12-09-2013
02:47 PM
|
0
|
0
|
1195
|
POST
|
To be able to display multiple features in my popups, I get the map onClick event and use that to select features in a feature layer using the code below. dojo.connect(map, "onClick", function (evt) {
selectMapFeatures(evt);
});
function selectMapFeatures (evt) {
featureLayer.clearSelection();
var query = new esri.tasks.Query();
/*query.geometry = evt.mapPoint;*/
query.geometry = pointToExtent(map, evt.mapPoint, 40);
var deferred = featureLayer.selectFeatures(query, esri.layers.FeatureLayer.SELECTION_NEW);
map.infoWindow.setFeatures([deferred]);
map.infoWindow.show(evt.mapPoint);
}
function pointToExtent(map, point, toleranceInPixel) {
var pixelWidth = map.extent.getWidth() / map.width;
var toleraceInMapCoords = toleranceInPixel * pixelWidth;
return new esri.geometry.Extent(point.x - toleraceInMapCoords,
point.y - toleraceInMapCoords,
point.x + toleraceInMapCoords,
point.y + toleraceInMapCoords,
map.spatialReference);
} This works as expected if I click near a group of features, as shown here... 12 features stacked and 12 features returned in popup. [ATTACH=CONFIG]29655[/ATTACH] However, when I click right on the graphic only a single feature is shown in the popup. I have tried intercepting the featureLayer onMouseUp event and passing that into the my selectMapFeatures function, but that doesn't work either. Any idea how to disable this behaviour so that my function will always be used? Full code: var map, featurelayer, toggle;
require([
"esri/map",
"esri/InfoTemplate",
"esri/dijit/Popup",
"esri/dijit/PopupTemplate",
"esri/dijit/BasemapToggle",
"esri/config",
"esri/layers/FeatureLayer",
"esri/renderers/UniqueValueRenderer",
"esri/symbols/SimpleLineSymbol",
"esri/symbols/SimpleMarkerSymbol",
"dojo/dom-construct",
"dojo/on",
"dijit/form/Button",
"dojo/domReady!",
"dojo/parser"
], function(
Map, InfoTemplate, PopupTemplate, Popup,
BasemapToggle, esriConfig, FeatureLayer, UniqueValueRenderer,
SimpleLineSymbol, SimpleMarkerSymbol, domConstruct, on
) {
var popup = new esri.dijit.Popup({
titleInBody: false
},domConstruct.create("div"));
var template = new esri.dijit.PopupTemplate({
description: "<b>{Asset}</b><br>"+
"{Address}<br>"+
"<a href={Website}>{Website}</a>",
fieldInfos: [{
fieldName: "Asset",
label: "Asset",
visible: false
}, {
fieldName: "Subcategor",
label: "Subcategory",
visible: true
}, {
fieldName: "Address",
label: "Address",
visible: true
}, {
fieldName: "Website",
label: "Website",
visible: true
}]
});
esriConfig.defaults.map.basemaps.vector = {
baseMapLayers: [
{ url: "http://myserver/ArcGISdev/rest/services/Basemaps/vectorbasemap/MapServer" }
],
title: "Basemap"
};
esriConfig.defaults.map.basemaps.imagery = {
baseMapLayers: [
{ url: "http://myserver/ArcGISdev/rest/services/Basemaps/ortho2013/MapServer" }
],
title: "2013 Imagery"
};
var ext = new esri.geometry.Extent(
{"xmin":670000,"ymin":4862260,"xmax":672400,"ymax":4864560,"spatialReference":{"wkid":26917}}
);
map = new Map("map", {
infoWindow: popup,
extent: ext,
/*center: [-70.651, 43.145],*/
zoom: 5,
logo: false,
basemap: "imagery",
sliderPosition: "top-left",
sliderStyle: "small",
sliderOrientation: "horizontal"
});
toggle = new BasemapToggle({
map: map,
basemap: "vector",
basemaps: {
vector: {
label: "Basemap",
url: "http://js.arcgis.com/3.7/js/esri/dijit/images/basemaps/topo.jpg"
}, imagery: {
label: "Imagery",
url: "http://js.arcgis.com/3.7/js/esri/dijit/images/basemaps/topo.jpg"
}
}
}, "BasemapToggle");
toggle.startup();
var symbol = new esri.symbol.SimpleMarkerSymbol(
esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE,
13, new esri.symbol.SimpleLineSymbol(
esri.symbol.SimpleLineSymbol.STYLE_SOLID,
new dojo.Color([255, 255, 255, 0.5]),
8
));
//create renderer
var renderer = new UniqueValueRenderer(symbol, "Category");
//add symbol for each possible value
renderer.addValue("CommunityCulturalOrganization", new esri.symbol.PictureMarkerSymbol("images/ico_CommunityCulturalOrganizations.png", 32, 37));
renderer.addValue("CulturalEnterprises", new esri.symbol.PictureMarkerSymbol("images/ico_CulturalEnterprises.png", 32, 37));
renderer.addValue("CulturalFacilities", new esri.symbol.PictureMarkerSymbol("images/ico_CulturalFacility.png", 32, 37));
renderer.addValue("CulturalHeritage", new esri.symbol.PictureMarkerSymbol("images/ico_CulturalHeritage.png", 32, 37));
renderer.addValue("FestivalsAndEvents", new esri.symbol.PictureMarkerSymbol("images/ico_FestivalsEvents.png", 32, 37));
renderer.addValue("NaturalHeritage", new esri.symbol.PictureMarkerSymbol("images/ico_NaturalHeritage.png", 32, 37));
featureLayer = new FeatureLayer("http://myserver/ArcGISdev/rest/services/culturemap/MapServer/0", {
infoTemplate: template,
mode: FeatureLayer.MODE_ONDEMAND,
outFields: ["*"]
});
featureLayer.setRenderer(renderer);
map.addLayer(featureLayer);
dojo.connect(dojo.byId('btnCultOrg'), 'onclick', function(e){
featureLayer.clearSelection();
featureLayer.setDefinitionExpression("Category='CommunityCulturalOrganization'");
});
dojo.connect(dojo.byId('btnCultEnt'), 'onclick', function(e){
featureLayer.clearSelection();
featureLayer.setDefinitionExpression("Category='CulturalEnterprises'");
});
dojo.connect(dojo.byId('btnCultFac'), 'onclick', function(e){
featureLayer.clearSelection();
featureLayer.setDefinitionExpression("Category='CulturalFacilities'");
});
dojo.connect(dojo.byId('btnCultHer'), 'onclick', function(e){
featureLayer.clearSelection();
featureLayer.setDefinitionExpression("Category='CulturalHeritage'");
});
dojo.connect(dojo.byId('btnFestEvt'), 'onclick', function(e){
featureLayer.clearSelection();
featureLayer.setDefinitionExpression("Category='FestivalsAndEvents'");
});
dojo.connect(dojo.byId('btnNatHer'), 'onclick', function(e){
featureLayer.clearSelection();
featureLayer.setDefinitionExpression("Category='NaturalHeritage'");
});
dojo.connect(featureLayer, "onClick", function (evt) {
selectMapFeatures(evt);
});
//intercept the onMouseUp event on featurelayer graphics to use the custom
//selectMapFeatures Task and not the default behaviour
dojo.connect(featureLayer, "onMouseUp", function (evt) {
selectMapFeatures(evt);
});
dojo.connect(map, "onClick", function (evt) {
selectMapFeatures(evt);
});
function selectMapFeatures (evt) {
featureLayer.clearSelection();
var query = new esri.tasks.Query();
/*query.geometry = evt.mapPoint;*/
query.geometry = pointToExtent(map, evt.mapPoint, 40);
var deferred = featureLayer.selectFeatures(query, esri.layers.FeatureLayer.SELECTION_NEW);
map.infoWindow.setFeatures([deferred]);
map.infoWindow.show(evt.mapPoint);
}
//this is just a function that buffers the click point by number of pixels and returns an Extent.
function pointToExtent(map, point, toleranceInPixel) {
var pixelWidth = map.extent.getWidth() / map.width;
var toleraceInMapCoords = toleranceInPixel * pixelWidth;
return new esri.geometry.Extent(point.x - toleraceInMapCoords,
point.y - toleraceInMapCoords,
point.x + toleraceInMapCoords,
point.y + toleraceInMapCoords,
map.spatialReference);
}
});
... View more
12-06-2013
10:07 AM
|
0
|
6
|
4905
|
POST
|
I have two popups configured in my viewer, one from a basemap layer and the other from an operational layer. What determines the display order of the popups when I click a location where features from both layers exist? The image below shows that the Parcel Info (from basemap layer) shows up first and I have to click next (2 of 2) to get to the Waste Collection Info (operational layer) popup. Can I change a configuration anywhere to make Waste Info show up as popup #1, the default? I played around with the title of the popups to see if it was sorted alphabetically, but it seems not. Do basemap layer popups always display before operational layer popups? Thanks, Ryan [ATTACH=CONFIG]25063[/ATTACH]
... View more
06-06-2013
07:03 AM
|
0
|
1
|
505
|
POST
|
When loading my flex viewer 3.1 compiled version, it will sometimes stop loading halfway through and become unresponsive (map will load, but not all header elements/widgets in widget container appear). If I reload the page, it comes up as expected and functions normally. When the problem occurs, content debugger reveals this: TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.esri.viewer.components.toc.tocClasses::TocMapLayerItem/createChildren() at com.esri.viewer.components.toc.tocClasses::TocMapLayerItem() at com.esri.viewer.components.toc::TOC/registerMapLayer() at MethodInfo-389() at com.esri.viewer.components.toc.utils::MapUtil$/forEachMapLayer() at com.esri.viewer.components.toc::TOC/registerAllMapLayers() at com.esri.viewer.components.toc::TOC/commitProperties() at mx.core::UIComponent/validateProperties() at mx.managers::LayoutManager/validateProperties() at mx.managers::LayoutManager/doPhasedInstantiation() at mx.managers::LayoutManager/doPhasedInstantiationCallback() Has anyone experienced this problem? Know of a solution? The fact that everything works fine after reloading confuses me. Thanks for the help!
... View more
02-26-2013
04:35 AM
|
0
|
3
|
504
|
POST
|
Thank you both to Robert and Rhett for the information. We will soon be upgrading to 10.1 so it wasn't horrible news that I can't use uniquevalsfromfield on a 9.3.1 map service. Again, thanks!
... View more
01-03-2013
08:38 AM
|
0
|
0
|
471
|
POST
|
Note: I'm using the compiled version for the 3.0 Viewer.
... View more
12-20-2012
07:16 AM
|
0
|
0
|
527
|
POST
|
Robert, Thanks for looking in to this. I was expecting the answer to be that 'it only works with 10', so I appreciate the time you're taking to investigate.
... View more
12-20-2012
07:01 AM
|
0
|
0
|
527
|
POST
|
So what is it do or not doing? Do you get the gathering unique values indicator with the count message? I briefly get the unique values indicator with the count message, although the count never moves from '0 of 0'. Then I get an empty drop down. [ATTACH=CONFIG]20104[/ATTACH] If I remove the uniquevalsfromfield="NAME" and just do a free form search on the layer, it does work.
... View more
12-20-2012
06:47 AM
|
0
|
0
|
527
|
POST
|
The service isn't public, so we can't do that. But maybe I just haven't configured it properly: <expression alias="NAME" textsearchlabel="Search by Street Name:"> [INDENT]<values> [INDENT][/INDENT]<value prompt="Example: Centre St S" isvaluerequired="true" uniquevalsfromfield="NAME">upper(NAME) LIKE upper('%[value]%')</value> </values>[/INDENT] </expression> The layer url tag is correct and the layer does have a field called NAME.
... View more
12-20-2012
06:29 AM
|
0
|
0
|
527
|
POST
|
Great widget, Robert! Thanks for all your work. Quick question: Does the uniquevalsfromfield tag for populating a drop down list only work against Server 10.x? I can't get it to work against 9.3.1. Thanks, Ryan
... View more
12-20-2012
05:52 AM
|
0
|
0
|
527
|
POST
|
As a follow-up to this, can ArcPad 10 run on a PC (non-windows mobile) that doesn't have ArcGIS installed? Or is an ArcGIS runtime license required? Thanks again.
... View more
02-28-2012
10:19 AM
|
0
|
0
|
593
|
POST
|
Not exactly the answer I had hoped for :), but the one I expected. Thanks for the quick response Tim.
... View more
02-27-2012
07:45 AM
|
0
|
0
|
593
|
POST
|
The project that I'm planning would ideally have the following components: 1) our desktop workstation with ArcPad 10 and Studio installed, where our file geodatabase will reside and data will be checked in/out from; 2) our mobile component of the project which would optionally be: [INDENT] Trimble unit and ArcPad application for most fieldwork laptop with same ArcPad application for certain scenarios where more screen real estate and a more comfortable editing experience is preferable [/INDENT] Is this possible with a single license of ArcPad? The fieldwork would only ever be done by a single individual on either the Trimble or the laptop, never both at once. The reason for wanting the same ArcPad application on the laptop, rather than just using ArcMap, is for the field user who won't be familiar with ArcMap and so that the same data collection workflows are followed. Thanks for the input. - Ryan
... View more
02-27-2012
06:51 AM
|
0
|
6
|
5346
|
POST
|
I just got my hands on ArcPad 10 and was excited to have related table forms created by default upon checking out my AXF. However, reading through the literature I now see that this won't be the case since I'm still on ArcPad Data Manager for ArcGIS 9.3. The literature here says that I "can still create custom forms for your related tables with ease, in ArcPad Studio 10". I have not yet been able to figure out how to do so "with ease". Am I missing something or will the workflow still require intensive customization to handle all data validation and SQL statements to update the related table (as with the Riverside developer's sample)?
... View more
02-07-2012
07:14 AM
|
0
|
1
|
588
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|