|
POST
|
For the first one, pan the map North until you see some map graphics. Click one of the map graphics and you should see a popup. We will alter the starting extent for this sample so that you see some data when the page initially loads (I think the underlying data chagned since the sample was written). Regarding the mobile sample, the problem appears to be related to this: dojo.connect(dijit.byId('map'), 'resize', resizeMap); We need to delete that line as with 2.5 it's no longer necessary. We'll update these samples soon, thanks for the heads up!
... View more
09-26-2011
09:54 AM
|
0
|
0
|
516
|
|
POST
|
Just wanted to make sure we closed the loop on this one!
... View more
09-26-2011
08:10 AM
|
0
|
0
|
1595
|
|
POST
|
It looks like I have to use Layer base class and use its visible property. Each instance of FeatureLayer does indeed have a visible property. Since FeatureLayer is added to map, its extent would always intersect map's extent.So, how extent intersection is gonna work for me?Please correct me if I am wrong. Why would a FeatureLayer's extent always intersect the map's current extent?
... View more
09-25-2011
03:15 PM
|
0
|
0
|
1772
|
|
POST
|
Hi Bob, Thanks for providing plenty of detail and a simple repro case. I haven't been able to get to the bottom of this. I've passed this on to someone who is a bit more knowledgable with regard to WMTS than me. I'll try to get you some more info by Monday.
... View more
09-24-2011
12:52 PM
|
0
|
0
|
3258
|
|
POST
|
Nothing jumps out at me...but if your getting features back now it's probably something with your symbol. Try adding graphics using the default symbology options:
graphic.setSymbol(new esri.symbol.SimpleMarkerSymbol());
map.graphics.add(graphic);
... View more
09-23-2011
02:50 PM
|
0
|
0
|
1111
|
|
POST
|
No, not natively anyway. Is that a binary format? If it's text-based you could probably do something with the HTML5 file API.
... View more
09-23-2011
02:28 PM
|
0
|
0
|
623
|
|
POST
|
I think you should look into using a feature layer as it can (probably) simplify your code as it can handle a lot of this work for you. Regarding your specific points... 1. Does that happen in all browsers? Which version of the API are you using? 2. Use show()/hide() to toggle the visibility of the layer rather than actually removing it from the map. 3. Don't repeatedly add/remove your layer. Use show() and hide(). Set your renderer before calling show().
... View more
09-23-2011
01:27 PM
|
0
|
0
|
1726
|
|
POST
|
Hi Charles, No worries about the code tags...it's just a suggestion. Regarding your code, try these two things first: do not add an additional slash on the map service URL when creating your find task specify layerIds on your findParameters Point number one isn't breaking anything, but that slash isn't necessary. Point number two can cause queries to fail, see this URL as an example: https://mapmaker.millersville.edu/ArcGIS/rest/services/PAplaces/MapServer/find?f=json&searchText=Philadelphia&contains=true&returnGeometry=true&searchFields=AREANAME
... View more
09-23-2011
11:36 AM
|
0
|
0
|
1111
|
|
POST
|
I know we had a workaround, but we did fix this in 2.5: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jshelp/new_v25.html
... View more
09-23-2011
10:20 AM
|
0
|
0
|
1595
|
|
POST
|
The findTask runs against a map service and you specify which layers you'd like to search using findParameters.layerIds. Try using your map service URL as opposed to the URL for a specific layer in the findTask constructor.
... View more
09-23-2011
10:09 AM
|
0
|
0
|
1111
|
|
POST
|
The problem is probably that you're querying a point layer with a single point. To return results, the points would have to be exactly the same, which isn't likely to happen. To get around this, create a small extent from your map click and use this extent as your query.geometry. Something like this:
var tolerance = 5,
pxWidth = map.extent.getWidth() / map.width,
padding = tolerance * pxWidth;
queryGeometry = new esri.geometry.Extent({
'xmin': evt.mapPoint.x - padding,
'ymin': evt.mapPoint.y - padding,
'xmax': evt.mapPoint.x + padding,
'ymax': evt.mapPoint.y + padding,
'spatialReference': evt.mapPoint.spatialReference
});
query.geometry = queryGeometry;
... View more
09-23-2011
09:55 AM
|
0
|
0
|
754
|
|
POST
|
I understand. What I posted previously still applies. In addition to testing if extents intersect, I'd also check each layer's visible property before doing a query.
... View more
09-23-2011
09:37 AM
|
0
|
0
|
1772
|
|
POST
|
You might be able to do what you want with CSS. Check out the attribute inspector's CSS classes.
... View more
09-22-2011
01:46 PM
|
0
|
0
|
2759
|
|
POST
|
Of course ;). There used to be a sample somewhere but I've lost track of it. I spent a little time putting together a new sample that shows this:
<!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" />
<!--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>Basemaps with an Opacity Slider</title>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.4/js/dojo/dijit/themes/nihilo/nihilo.css">
<style>
html, body { height: 100%; width: 100%; margin: 0; padding: 0; }
#map{ padding: 0; }
#sliderWrapper {
position:absolute;
right: 30px;
top:30px;
z-Index: 40;
width: 250px;
height: 50px;
background: #fff;
-moz-box-shadow: 0 0 5px #888;
-webkit-box-shadow: 0 0 5px #888;
box-shadow: 0 0 5px #888;
}
#sliderLabels {
position: relative;
top: -1px;
height: 1.2em;
font-size: 80%;
font-weight: bold;
font-family: arial;
color: #444;
padding: 3px;
margin: 5px 10px 0 10px;
}
</style>
<script type="text/javascript">var dojoConfig = { parseOnLoad: true };</script>
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.4"></script>
<script type="text/javascript">
dojo.require("esri.map");
dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.ContentPane");
// one global for all app vars
var app = {};
function init() {
var ext = new esri.geometry.Extent({"xmin":-14628212,"ymin":714227,"xmax":7718305,"ymax":9832858,"spatialReference":{"wkid":102100}});
app.map = new esri.Map("map", { extent: ext });
app.imagery = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer");
app.map.addLayer(app.imagery);
app.streets = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
app.map.addLayer(app.streets);
dojo.connect(dijit.byId('sliderOpacity'), 'onChange', changeOpacity);
var resizeTimer;
dojo.connect(app.map, 'onLoad', function(theMap) {
dojo.connect(dijit.byId('map'), 'resize', function() { //resize the map if the div is resized
clearTimeout(resizeTimer);
resizeTimer = setTimeout( function() {
app.map.resize();
app.map.reposition();
}, 500);
});
});
}
function changeOpacity(op) {
var newOp = (op / 100);
app.streets.setOpacity(1.0 - newOp);
app.imagery.setOpacity(newOp);
}
dojo.ready(init);
</script>
</head>
<body class="nihilo">
<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'">
<div id="sliderWrapper"> <!-- slider divs -->
<div id="sliderOpacity"
data-dojo-type="dijit.form.HorizontalSlider"
data-dojo-props="showButtons:'true', value:0, minimum:0, maximum:100, discreteValues:101, intermediateChanges:true">
<ol id="sliderLabels"
data-dojo-type="dijit.form.HorizontalRuleLabels"
data-dojo-props="container:'topDecoration'">
<li>Streets</li>
<li>Satellite</li>
</ol>
</div>
</div> <!-- end slider divs -->
</div>
</div>
</body>
</html>
We should probably put this in the official samples...
... View more
09-22-2011
01:14 PM
|
1
|
0
|
1826
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-23-2012 07:54 AM | |
| 1 | 05-28-2010 08:31 AM | |
| 1 | 11-12-2012 08:12 AM | |
| 3 | 02-23-2012 10:57 AM | |
| 1 | 06-27-2011 08:51 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|