|
POST
|
I would like to access and reset the value for the basemap and zoom via a javascript form field. my question is how to I access these. I am able to acces the map width but not these three items.
function init() {
map = new esri.Map("map", {
center: [-31.036, 42.747],
zoom: 8,
basemap: "streets"
});
You can get to the array of basemaps using map.basemapLayerIds, so the first basemap will be map.basemapLayerIds[0] map.getZoom() will return the zoom level while map.setZoom(10) will set the level. Cheers, Steve
... View more
02-04-2013
08:11 PM
|
0
|
0
|
1242
|
|
POST
|
Hi Luke, I'm not sure whether there's a method or property to return this directly. If not, you could iterate through the geometries in your feature collection and union the extents cumulatively. The end result would be the combined extent of all features. Steve
... View more
02-04-2013
12:52 PM
|
0
|
0
|
1237
|
|
POST
|
We didn't quite go full Zeldman for the site but I'd be lying if I said we weren't at least a little influenced by design elements from the A List Apart crowd. For what it's worth*, I'd argue that the two sites have very different purposes - ALA is optimised for reading articles, whereas the Esri site needs to be aimed at providing information. But thanks for responding and making the recent changes, which are definitely making a difference. * I realise it's not worth much 😉
... View more
02-03-2013
02:28 PM
|
0
|
0
|
1602
|
|
POST
|
Is there any way to disable these debug logs in production? That would be like putting masking tape over the "low oil" warning light 😉 Why not fix the errors? It's likely that in ArcMap, you have switched off the SHAPE field before publishing this layer to ArcGIS Server, so the SHAPE field isn't accessible to the JS API. Go to your layer's REST endpoint (eg http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/WaterTemplate/LocalGovernmentInfrastructureBasemap/MapServer/1) and verify that the SHAPE field is shown. If not, switch it on in ArcMap and republish this layer. Steve
... View more
01-30-2013
01:11 PM
|
0
|
0
|
1749
|
|
POST
|
I can't see in the documentation whether a feature layer supports on-the-fly projection. But a quick test shows it doesn't seem to work when adding a feature layer with WKID = 4283 on a Web Mercator map. The same layer, when defined as dynamic, does display. Should a feature layer automatically project on-the-fly? Is there a way to force it to reproject? Thanks, Steve
... View more
01-29-2013
02:14 PM
|
0
|
2
|
1212
|
|
POST
|
Here's a minor bug introduced at 3.3. The new zoomSlider style is actually +/- buttons rather than a slider. If you simply specify {isZoomSlider: false} the buttons are still shown. You need to specify {isZoomSlider: false, sliderStyle: "large" for the buttons to be removed. It seems that if isZoomSlider is false, none of the zoom controls should be shown (eg, you don't want to allow zooming, or you're controlling it yourself). Cheers, Steve
... View more
01-27-2013
10:35 AM
|
0
|
4
|
2914
|
|
POST
|
though it's not recommended, if you really have to avoid dojo.connect, you can simply override the event with the function as events are functions essentially. For example, you can replace dojo.connect(map, "onExtentChange", showExtent); as: map.onExtentChange = showExtent; Hi Jian, Is there any particular reason why this isn't recommended? It seems pretty succinct and straightforward. Thanks, Steve
... View more
01-27-2013
12:21 AM
|
0
|
0
|
2473
|
|
POST
|
But do u know the below code can write it on Jquery. No idea, sorry.
... View more
01-22-2013
06:11 PM
|
0
|
0
|
2473
|
|
POST
|
There's a sample here which might give you some pointers as to what's possible: http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/#sample/framework_jquery Note that this sample still uses dojo.connect.
... View more
01-22-2013
05:29 PM
|
0
|
0
|
2473
|
|
POST
|
I'm afraid I won't be able to overcome inline style attributes in the HTML Oh well, what you've got looks great anyway 😉
... View more
01-22-2013
01:45 PM
|
0
|
0
|
1816
|
|
POST
|
Hi Derek, It's been a few years since I looked at this, but here's a map I worked on which includes a customised time slider: http://atlas.nsw.gov.au/public/nsw/home/map/elections.html I can't remember exactly how we handled the styling, but you may be able to reverse-engineer it? Steve
... View more
01-22-2013
01:14 PM
|
0
|
0
|
1816
|
|
POST
|
How can I write the code to turn off the base map, and another code to turn on later? You can get a handle on the basemap using map.basemapLayerIds - by default I think it's called "layer0". var bm = map.getLayer("layer0"); bm.setVisibility(false); //to switch off bm.setVisibility(true); //to switch on Steve
... View more
01-22-2013
01:10 PM
|
0
|
0
|
1169
|
|
POST
|
http://help.arcgis.com/en/webapi/javascript/arcgis/jshelp/#intro_devenvfirst line on the page, "When developing with the ArcGIS API for JavaScript, a web server is required."Easy to overlook? Yes. But it's documented. You'll encounter situations like this often.cheers. Derek, I'm 100% certain that that passage wasn't there when this thread was started, cos I trawled the whole beginners sections looking for a link to include. Glad to see it's been added. Cheers,Steve
... View more
01-22-2013
11:22 AM
|
0
|
0
|
503
|
|
POST
|
Hi guys, The "download and configure" link on the Using the Proxy Page reference links to a broken URL: http://help.arcgis.com/en/webapi/javascript/arcgis/jshelp/#Download_Configure Thanks, Steve EDIT: the required information is actually found further down on the same page - but it's still confusing that the link is broken.
... View more
01-19-2013
04:23 PM
|
0
|
0
|
957
|
|
POST
|
See the attached sample, which loads a simple map with a tiled layer and attempts to run a printTask using a sample Esri server at http://servicesbeta4.esri.com/arcgis/rest/services/Utilities/ExportWebMap/GPServer/Export Web Map Task
printTask.execute(params, printResult, printError);
If you watch in FireBug, this immediately returns an error message: NetworkError: 503 Service Unavailable... server is at capacity However, the printError function doesn't seem to fire, and doesn't contain the message about the server being unavailable/at capacity. EDIT: it does correctly return an error response if I point it to another print server which exists but is switched off. Thanks, Steve
... View more
01-16-2013
03:46 PM
|
0
|
1
|
896
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-17-2014 08:45 PM | |
| 1 | 03-15-2011 04:23 PM | |
| 1 | 10-18-2019 12:50 AM | |
| 3 | 01-22-2019 02:33 PM | |
| 1 | 09-26-2011 10:36 PM |
| Online Status |
Offline
|
| Date Last Visited |
10-20-2022
12:19 AM
|