|
POST
|
The reference for SimpleMarkerSymbol only lists circles, squares, etc so it may be a limitation of symbolising a feature layer? As a workaround, can you make an image of the "M" and use a PictureMarkerSymbol? Note that I haven't tried this so it's just a guess (based on the idea that symbolising a feature layer is probably using the same mechanisms as symbolising a graphics layer). I appreciated your suggestion. SimpleMarkerSymbol and PictureMarkerSymbol are used to draw points and multipoints not polyline. I konw there is no MarkerLineSysmbol class in JS API (as it has in ArcGIS desktop). I was hoping i can get a clear answer of whether it is feasible in JS API to apply MarkLineSymbol on featureLayer.
... View more
06-22-2011
04:56 AM
|
0
|
0
|
718
|
|
POST
|
I have a polyline layer symboled with Marker Line Symbol (using Character Marker (Unicode: 233 - looks like "M" as unit). If you displaye as a layer in map service, it works just as it is in .mxd; if I diplay as a featurelayer, the map only honor the color and character size, which results in a big fat line. Do anyone has ideas how to fix or workaround?
... View more
06-21-2011
01:19 PM
|
0
|
3
|
2939
|
|
POST
|
Not sure what the problem is. I'm able to reach the site with no problems from outside of our network. Maybe our server was having problems? Here is some of the relevant code:
initViewer: function(llPoint){
// summary:
//
// mapPoint: esri.geometry.Point
// In UTM
console.log(this.declaredClass + "::" + arguments.callee.nom, arguments);
var svPoint = new google.maps.LatLng(llPoint.y, llPoint.x);
var panoramaOptions = {
position: svPoint,
pov: {
heading: 0,
pitch: 0,
zoom: 1
}
};
this.panorama = new google.maps.StreetViewPanorama(dojo.byId("streetview-container-inner"), panoramaOptions);
this.svService = new google.maps.StreetViewService();
this.validateLocation(svPoint);
this.wireEvents();
},
repositionViewer: function(llPoint){
// summary:
// Points the viewer to a new position after the user clicks on the map
// llPoint: esri.geometry.Point projected to lat long
console.log(this.declaredClass + "::" + arguments.callee.nom, arguments);
var svPoint = new google.maps.LatLng(llPoint.y, llPoint.x);
this.panorama.setPosition(svPoint);
this.validateLocation(svPoint);
},
onPovChanged: function(){
// summary:
// Fires when the point of view of the streetview viewer is changed.
// Updates the graphic's orientation.
//console.log(this.declaredClass + "::" + arguments.callee.nom, arguments);
var symbol = this.graphic.symbol.setAngle(this.panorama.getPov().heading);
this.graphic.setSymbol(symbol);
},
validateLocation: function(pnt){
// summary:
// Checks to make sure that there is a valid panorama for the location
// pnt: google.maps.LatLng
console.log(this.declaredClass + "::" + arguments.callee.nom, arguments);
this.svService.getPanoramaByLocation(pnt, 50, function(data, status){
if (status != "OK"){
dojo.style("no-data-message", "display", "block");
} else {
dojo.style("no-data-message", "display", "none");
}
});
},
Attached is a modified esri sample page to include google streeview. As you can see, adding a google streetview is simple and straightforward and can be easily integrated into javascript client environment.
... View more
06-20-2011
07:26 AM
|
1
|
1
|
4998
|
|
POST
|
What are the errors your'e seeing? None errors not even warnings.
... View more
06-17-2011
10:17 AM
|
0
|
0
|
823
|
|
POST
|
Looks like it's working for me. What specifically is not working for you? It does not show map on my IE 8 and could not add critical issue on my Goole Chrome 11.
... View more
06-17-2011
09:37 AM
|
0
|
0
|
823
|
|
POST
|
It looks like you are executing the queryTask2 before listening for callback. Try changing the order of lines: queryTask2.execute(query2); dojo.connect(queryTask2, "onComplete", selectTracts); to: dojo.connect(queryTask2, "onComplete", selectTracts); queryTask2.execute(query2); Thanks, Jignesh Also you don't need to connect an event every time in you method. set queryTask and queryTask2 as globel variable and define handlers one time in your init() function Like the following: var queryTask, queryTask2; function init() { ... queryTask= new esri.tasks.QueryTask("http://128.146.162.230/arcgis/rest/services/KC_zipcodes/MapServer/2"); dojo.connect(queryTask, "onComplete", zoomToZip); ..... queryTask2= new esri.tasks.QueryTask("http://128.146.162.230/arcgis/rest/services/KingCountyAllOverlaysForQueryNew/MapServer/0"); dojo.connect(queryTask2, "onComplete", selectTracts); ..... } ..... function QueryByZip(Zip_ID){ map.graphic.clear(); dijit.byId('progress').show(); query = new esri.tasks.Query(); query.where = "ZIP = '" + Zip_ID + "'"; query.returnGeometry = true; query.outFields = ["ZIP"]; queryTask.execute(query); } function zoomToZip(featureSet){ var features = featureSet.features; var zipGraphic; for (var i=0, il=features.length; i<il; i++) { zipGraphic = new esri.Graphic(features); map.graphics.add(zipGraphic.setSymbol(zipSymbol)); } query2 = new esri.tasks.Query(); query2.geometry = zipGraphic.geometry; query2.spatialRelationship = esri.tasks.Query.SPATIAL_REL_INTERSECTS; query2.returnGeometry = true; queryTask2.execute(query2); } function selectTracts(featureSet) { var featureTracts = featureSet.features; var tractGraphic; for (var i=0, il=featureTracts.length; i<il; i++) { tractGraphic = new esri.Graphic(featureTracts); map.graphics.add(tractGraphic.setSymbol(highlightSymbol)); } map.setExtent(tractGraphic.geometry.getExtent()); }
... View more
06-17-2011
07:35 AM
|
0
|
0
|
1243
|
|
POST
|
The sample http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/mobile_citizenrequest.html is not working.
... View more
06-17-2011
06:33 AM
|
0
|
6
|
1288
|
|
POST
|
I have written the following hacked together function which will deactivate the measurement widget. Calling measurement.deactivate() will deselect any selected function and return to the usual map tools. Hope it's useful to others.
var measurement = new esri.dijit.Measurement({
map: map
}, dojo.byId('measurement'));
measurement.deactivate = function() {
var locationBtn = dijit.byId('location'),
distanceBtn = dijit.byId('distance'),
areaBtn = dijit.byId('area')
this.closeTool();
locationBtn.setAttribute('checked', false);
distanceBtn.setAttribute('checked', false);
areaBtn.setAttribute('checked', false);
}
Extra info in case you are interested. you can also do it by the following. locationBtn.setActive(false); distanceBtn.setActive(false); areaBtn.setActive(false); setActive to false will deselect those button, therefore no action will be taken.
... View more
06-17-2011
06:06 AM
|
0
|
0
|
3386
|
|
POST
|
I was wondering if anyone could point me in the direction of a sample or examples of streetview working within a js api. Thanks Si Google streetview is a part of Google Map API written in javascript. So there should be no problem in coorperating it into a JS API app (Though i have not done in JS API, I personally did it in a JS API extension for Google Maps app and a Silverlight API app). Following several steps, you should be able to do it pretty easy. 1. Reference Google Map api like this: <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAafYhVvNL6Z1zKauFqmXIUxSFwSTfUFI-UnYzfYyRP8xyoN2P1RQdRxCT3T-hymFLj26OJYTdWGreZg" type="text/javascript"></script> (get your own key from esri or google). 2. create a GStreetviewPanorama and a GStreetviewClient instance. 3. use GStreetviewPanorama.getNearestPanorama(point or address, callback) to verify whether you have streetview available for that point or address. 4. If data available, then use GStreetviewClient.setLocationAndPOV(point or address) to open streeview to that point or address. 5 Optional. Use GEvent.addListener(GStreetviewPanorama, 'initialized', callback) to synchronize the streeview changed and the point symbol on your JS API map. Here is the part of my working code, hope it will give me some clue. (if a lot of people are interested, i will develop a sample JS API Page and post here) <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAafYhVvNL6Z1zKauFqmXIUxSFwSTfUFI-UnYzfYyRP8xyoN2P1RQdRxCT3T-hymFLj26OJYTdWGreZg" type="text/javascript"></script> <script type="text/javascript"> var Glocator; var gviewClient; var Pano; var viewStatus = false; var viewAddress = ""; var viewClickPoint; function openStreetView() { setupStreetViewUtilies(); viewClickPoint = new GLatLng(window.opener.y, window.opener.x); gviewClient.getNearestPanorama(viewClickPoint, showStreetView); GEvent.addListener(Pano, "error", handleNoFlash); } function setupStreetViewUtilies() { if (Glocator == null) Glocator = new GClientGeocoder(); if (gviewClient == null) gviewClient = new GStreetviewClient(); if (Pano == null) Pano = new GStreetviewPanorama(document.getElementById("Results")); } function showStreetView(gStreetviewData) { if (gStreetviewData.code != 200) { //no street view for this location if (Pano != null) Pano.hide(); //hide the street view viewStatus = false; viewAddress = ""; //self.close(); //alert("No street view for this location"); } else { //street view is available viewStatus = true; viewAddress = gStreetviewData.location.description; viewClickPoint = gStreetviewData.location.latlng; GEvent.addListener(Pano, 'initialized', streetViewChanged); // add an event handling street view changes Pano.setLocationAndPOV(viewClickPoint); //push the pano to a this location } Glocator.getLocations(viewClickPoint, showStreetAddress); //show street address info } function handleNoFlash(errorCode) { if (errorCode == FLASH_UNAVAILABLE) { alert("Error: Flash doesn't appear to be supported by your browser"); return; } } function showStreetAddress(response) { var descContent = ""; if (!response || response.Status.code != 200) { if (viewAddress != "") descContent = "<table width='95%'><tr><td><b>View Point Address:</b></td><td>" + getlocalAddress(viewAddress) + "</td></tr><tr><td><b>View Point Lat/Lon:</b></td><td>" else descContent = "<table width='95%'><tr><td><b>View Point Address:</b></td><td>UnKnown Address</td></tr><tr><td><b>View Point Lat/Lon:</b></td><td>" descContent += viewClickPoint.lat() + ", " + viewClickPoint.lng() + "</td></tr><tr><td>"; } else { var place = response.Placemark[0]; var point = new GLatLng(place.Point.coordinates[1], place.Point.coordinates[0]); descContent = "<table width='95%'><tr><td><b>View Point Address:</b></td><td>" + getlocalAddress(place.address) + "</td></tr><tr><td><b>View Point Lat/Lon:</b></td><td>" + place.Point.coordinates[1] + ", " + place.Point.coordinates[0] + "</td></tr><tr><td>"; } descContent += "<b>View Available:</b></td><td>" + viewStatus + "<td><tr></table>"; document.getElementById("Desc").innerHTML = descContent; } function getlocalAddress(Addr) { var index = Addr.indexOf(','); return Addr.substring(0, index); } function streetViewChanged(streetLocation) { viewStatus = true; viewAddress = streetLocation.description; viewClickPoint = streetLocation.latlng; var corStr = viewClickPoint.lng() + "," + viewClickPoint.lat(); //call back on Map to plug in a new camera picture in changed location var SLPlugin = window.opener.document.getElementById("CityMap"); SLPlugin.Content.CityMap.AddCameraOnMap(corStr); Glocator.getLocations(viewClickPoint, showStreetAddress); } function closePopup() { //clear up street view icon var SLPlugin = window.opener.document.getElementById("CityMap"); SLPlugin.Content.CityMap.RemoveCameraOnMap(); } function loadDirections() { alert(window.opener.dDriections); var directions = new Array(); directions = window.opener.dDriections.split(':'); var Desc_Table = "<table id='DirectionTB' width='400'>"; //add rout name Desc_Table += "<tr><td><b>" + directions[0] + "</b></td></tr>"; //add driving distances Desc_Table += "<tr><td><b>" + directions[1] + "</b></td></tr>"; //add driving time Desc_Table += "<tr><td><b>" + directions[2] + "</b></td></tr>"; //add driving steps for (var i = 3; i < directions.length; i++) { Desc_Table += "<tr><td><b>" + directions + "</b></td></tr>"; } document.getElementById("Results").innerHTML = Desc_Table; } </script>
... View more
06-17-2011
05:36 AM
|
1
|
0
|
4998
|
|
POST
|
ali7789v4;110414 wrote: Hi I have had a go with the identify task, and it works. I haven't tried to integrate it into my main project yet, just a modified version of the ESRI example. However, it turns out you have to click EXACTLY on the precise pixel of the little map marker for the identify tool to work. It really needs to work like google map markers, where you can click anywhere on the marker icon itself and it will identify ok. The map markers I'm using are defined in the MSD. What can you suggest? you could set IdentifyParameters.tolerance =2 or more(pixel distance) to give your identify point a wider searching area.
... View more
06-16-2011
06:44 AM
|
0
|
0
|
1438
|
|
POST
|
Hi I want to do something which appears to be more complicated than I first thought, although it's probably simple for someone who knows what they're doing. I have a map, with some vectors that you can click on to find out information about. Which is fine, but in another layer of my MSD, I have some points - just markers that indicate locations of facilities. At the moment when I make the points layer visible (using the standard buildLayerList/updateLayerVisibility function from the ESRI examples) they markers appear on top of the vectors - which is exaclty right. I want to make the markers clickable, so that when you click on them, you get a popup about the facility's name etc. I'm not sure how to do this!!! Do I need to actually do a small buffer search on the specific points layer? As the vectors will be clickable, and I want the facilities to be too, I'm not sure how to handle that without having a seperate tool, but that's a seperate issue - the major issue I have is being able to make them clickable once they are visible. Hope that makes sense and grateful for any help you can give. Thanks one feasible approach would be doing a identify task (with layerOption LAYER_OPTION_VISIBLE) on your MSD. The result is an array of IdentifyResult which will tell you the info of the feature (layer id, layer name, attributes etc) you clicked. Then you can associate the feature with infowindow.
... View more
06-15-2011
06:39 AM
|
0
|
0
|
1438
|
|
POST
|
Hi experts, I want to give my users the capability of explicitly saving the edits done to data.However, the web help article says that geometry edits are saved automatically. (under Editing behaviors:section ) So, my question is, how can I provide my users with a button to commit changes to sde (geometry and attribute changes).In Silverlight API, we have one property on the FeatureLayer class to do this. So, is there any similar thing available to achieve this in JS API? Thanks in advance. Sanjay. Look into JSAPI FeatureLayer's applyEdits(adds?, updates?, deletes?, callback?, errback?) method.
... View more
06-15-2011
06:20 AM
|
0
|
0
|
489
|
|
POST
|
Hi! Glad to use this forum! I have a question for experts. How can I use JScript API ArcGIS Server to get polygons ID that touch to the selected polygon? Thanks a lot for your time! Not sure exactly what your situation is , there are a couple of ways to achieve your goal throught JS API. GeometryService.relation(relationParameters, callback?, errback?) computes the two sets of geometries that belong to the specified relation, you could specify the relationParams.relation constant to the relationship you would like to compute (SPATIAL_REL_LINETOUCH or specify SPATIAL_REL_RELATION); Or you could do a QueryTask using a spatial filter (esri.tasks.Query.spatialRelationship = esri.tasks.Query.SPATIAL_REL_TOUCHES or specify SPATIAL_REL_RELATION), it find out the feature(s) from one layer (or graphic(s)) touches the border of feature(s) from another layer.
... View more
06-15-2011
05:23 AM
|
0
|
0
|
1002
|
|
POST
|
Thank you Renee, I'd like to echo your comments. The date field worked just fine at 2.2, this is definitely a backwards step at 2.3. If anyone has a code solution for this I'd be grateful to see it, but in the meantime we're sticking with 2.2 for our editing APIs. Thanks, Mark. I agree with Mark. ESRI should look into this issue. At the same time, Except for the Kelly's suggestion, i found a workaround for edit feature for my purpose. Here is the code: dojo.connect(pointsOfInterest, "onSelectionComplete", function(features) { dojo.forEach(features, function(feature) { if (feature.attributes.notedate==null) { feature.attributes.notedate = {}; } }); }); Hope it helps
... View more
06-14-2011
07:56 AM
|
0
|
0
|
2695
|
|
POST
|
Wow thanks. I poked around and could not see where the CSS attributes for the JS API features were located. Where are these described so I know where to find the others? Also do you know if they are device dependand based on CSS? For example certain features defaulting to visible for iOS vs Chrome etc? I am not sure exactly where it is located (I figured it out by looking at ESIR samples. Maybe in Compact api). It would be nice that ESRI could document those css class in more detail (like they did in some of the JS API).
... View more
06-13-2011
09:13 AM
|
0
|
0
|
695
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-11-2011 12:16 PM | |
| 1 | 05-25-2017 08:26 AM | |
| 1 | 06-02-2017 07:37 AM | |
| 1 | 06-28-2011 07:02 AM | |
| 1 | 06-12-2017 10:10 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-01-2024
09:57 PM
|