|
POST
|
After upgrading to server 10.2 identify and query are returning different geometry for the same feature. Identify is correct, while query has an offset. I posted in the server forum http://forums.arcgis.com/threads/92716-10.2-query-and-identify-return-different-geometry-for-same-fetaure Since I'm using the jsapi thought I'd see if anyone here has experienced this.
... View more
09-16-2013
08:49 AM
|
0
|
0
|
899
|
|
POST
|
Try this layout. You can nest a BorderContainer as a region. Toolbar is top region in nested BorderContainer along with map as the center region. For your right region just use a TabContainer. [HTML]<div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'sidebar', gutters:true, liveSplitters:true, style:'width:100%;height:100%;margin:0;padding:0;z-index:1;'"> <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top', splitter:false, style:'height:100px;z-index:1;'"> Header </div> <div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="region:'center', design:'sidebar', gutters:true, liveSplitters:false, style:'z-index:1;'"> <div data-dojo-type="dijit/Toolbar" data-dojo-props="region:'top', style:'z-index:1;'"> <!-- Toolbar buttons here --> </div> <div id="map" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="Title:'Tab 1', style:'padding:0;overflow:hidden;z-index:1;'"> </div> </div> <div data-dojo-type="dijit/layout/TabContainer" data-dojo-props="region:'right', minSize:300, style:'width:300px;z-index:1;'"> <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="Title:'Tab 1'"> Right tab 1 </div> <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="Title:'Tab 2'"> Right tab 2 </div> </div> <div>[/HTML]
... View more
09-03-2013
02:45 PM
|
0
|
0
|
974
|
|
POST
|
how do i get the data automatically using the esrirequest() , when more data come in. or what is the best practice to do this. It depends on how many points you are going to load. You can get all the points in one server call and add them to the map (equivalent to FeatureLayer SNAPSHOT mode), or you can connect to the map's zoom-end & pan-end events, requesting just the points within the map's extent (equivalent to FeatureLayer ONDEMAND mode). The latter seems like it would work best if new database entries are being created in real time albeit quite a bit more complex on the client side. I would create a custom layer class in that scenario.
... View more
09-03-2013
07:53 AM
|
0
|
0
|
1949
|
|
POST
|
Betsy, I know of the increased size on show phenomenon. I don't understand it completely, but it's a layout issue with padding coupled with the floating pane's containerNode wanting to resize with padding on show. The critical part of the fix is padding:0 !important; in the .dojoxFloatingPane class. First, here's a code update: var mapinfofp = new dojox.layout.FloatingPane({ id: 'map-info-floating-pane', title: 'Map Information', resizable: false, resizeAxis: null, closable: false, dockable: true, dockTo: app.layout.dock, style: 'position:absolute;top:90px;left:340px;width:270px;height:215px;visibility:hidden;overflow:hidden;', href: 'html/map-info.html', preload: false }, dojo.create('div', null, dojo.body())); mapinfofp.startup(); mapinfofp.on('focus', function () { mapinfofp.bringToTop(); }); mapinfofp.on('show', function () { mapinfofp.bringToTop(); }); Note the content wrapped in div with dojoxFloatingPaneWrapper class: [HTML] <div class="dojoxFloatingPaneWrapper"> <div data-dojo-type="mods/widget/MapInfo" data-dojo-props="map:app.map"></div> </div>[/HTML] The CSS: /* floating pane */ .dojoxFloatingPaneWrapper { padding:8px; } .dojoxFloatingPane { padding:0 !important; border:solid 1px #769DC0 !important; } .dojoxFloatingPaneTitle { border: 1px solid #ffffff; border-top: none; background-color: #abd6ff; background-image: url("http://ajax.googleapis.com/ajax/libs/dojo/1.9.1/dijit/themes/claro/images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none; padding: 5px 7px 4px 7px; } .dojoxFloatingPaneContent { border-top:solid 1px #769DC0; padding:0; overflow:hidden } .dojoxFloatingMinimizeIcon { /*custom minimize icon if desired*/ }
... View more
08-29-2013
08:33 AM
|
3
|
0
|
3400
|
|
POST
|
Is there a reason you don't just set the infoTemplate of the feature layer?
... View more
08-29-2013
06:58 AM
|
0
|
0
|
1882
|
|
POST
|
FeatureLayer variable name As in the layer itself or any of the layer's properties, functions, etc? //the layer itself var layer = graphic.getLayer(); //the layer's id var layerId = graphic.getLayer().id; function getTextContent(graphic) { if (graphic.getLayer().id === 'feature_layer_one') { //do stuff } else if (graphic.getLayer().id === 'feature_layer_two') { //do stuff } } You would need to set the feature layer's id on creation. var fl = new esri.layers.FeatureLayer(url, { mode: 1, id: 'feature_layer_one' });
... View more
08-28-2013
01:48 PM
|
0
|
0
|
1882
|
|
POST
|
I'm not exactly 100% on the workflow that get's you to getTextContent(graphic) or how undefined would be returned if you return something else when SHELTER is undefined.
... View more
08-28-2013
12:57 PM
|
0
|
0
|
1882
|
|
POST
|
function getTextContent(graphic) {
if (graphic.attributes.SHELTER === undefined) {
//do stuff
} else {
//do stuff
}
}
... View more
08-28-2013
10:55 AM
|
0
|
0
|
1882
|
|
POST
|
When creating json of a graphic it would be nice to optionally specify whether or not to include symbol, attributes and infoTemplate in the result. Like this for example: var json = graphic.toJson(
{
infoTemplate: false
}
); Just a thought. Keep up the good work jsapi team!
... View more
08-27-2013
03:04 PM
|
0
|
0
|
713
|
|
POST
|
Sorry...use dijit.byId because it's a widget. dijit.byId('toolBuffer').get('value');
... View more
08-27-2013
10:55 AM
|
0
|
0
|
5108
|
|
POST
|
Try this: Add value as property: [HTML]<input id="toolBuffer" data-dojo-type="dijit/form/Button" data-dojo-props="iconClass:'findNear', showLabel: false, value: 'buff'"></button>[/HTML] Use .get('value') to get the value: dom.byId('toolBuffer').get('value');
... View more
08-27-2013
10:40 AM
|
0
|
0
|
3978
|
|
POST
|
Joel, You can create your own json with php. Php is easy but any server side scripting, which can access the database will work, e.g. asp.net, etc. Php has the json_encode() function which converts arrays to json. Here's a sample that returns json of map annotation projects to the application for the user to select one to load. [PHP]<?php $user = $_POST["user"]; $mysqli = new mysqli("HOST", "USER", "PASSWORD", "DATABASE"); if ($mysqli->connect_errno) { $connectfail = array( 'success' => false, 'message' => $mysqli->connect_error ); echo json_encode($connectfail); return; } if ($user === '*') { $query = "SELECT id, project, description, created_by, created_time, updated_by, updated_time FROM anno_projects"; } else { $query = "SELECT id, project, description, created_by, created_time, updated_by, updated_time FROM anno_projects WHERE created_by = '" . $user . "'"; } $result = $mysqli->query($query); if ($mysqli->error) { $loadfail = array( 'success' => false, 'message' => $mysqli->error ); echo json_encode($loadfail); return; } while ($row = $result->fetch_assoc()) { $project = array( 'id' => (int) $row["id"], 'project' => $row["project"], 'description' => $row["description"], 'createdBy' => $row["created_by"], 'createdTime' => (float) $row["created_time"], 'updatedBy' => $row["updated_by"], 'updatedTime' => (float) $row["updated_time"] ); $projects[] = $project; } $result->close(); $loadsuccess = array( 'success' => true, 'projects' => $projects, 'message' => 'Projects successfully retrieved.' ); echo json_encode($loadsuccess); $mysqli->close(); ?>[/PHP] Use esri.request to post any params and handle the response: esri.request({
url: 'html/anno/project-get-projects.php',
content: {
user: user
},
handleAs: 'json',
callbackParamName: 'callback'
}, { usePost: true }).then(function (response) {
if (response.success) {
//console.log(response);
//create dgrid for user to select project to load
} else {
console.log(response.message);
app.error(response.message);
}
}, function (error) {
console.log(error);
app.error('An error has occured.')
});
... View more
08-27-2013
08:12 AM
|
0
|
0
|
1949
|
|
POST
|
Look at Derek's post. I missed the fact myFunction() wasn't also globally available.
... View more
08-26-2013
09:23 AM
|
0
|
0
|
3978
|
|
POST
|
onClick will not work on html elemets. You want onclick. <button onclick="myFunction()">Pick Point</button> onClick is a dojo event for widgets like dijit/form/Button. <div data-dojo-type="dijit/form/Button" data-dojo-props="label: 'Pick Point', onClick: function() { myFucntion() }"></div>
... View more
08-26-2013
08:29 AM
|
0
|
0
|
3978
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-18-2013 06:56 AM | |
| 1 | 06-30-2015 09:17 AM | |
| 1 | 10-12-2013 07:14 AM | |
| 1 | 02-05-2014 11:05 AM | |
| 1 | 05-28-2015 11:41 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|