|
DOC
|
Kevin, I understand what you want now. If you want a quick workaround to stop adding the perimeter measurement, you can comment out line 1317 in the latest release of the widget. This line adds the perimeter text graphic to the map. Commenting it out would eliminate it from drawing it. The code should look like this: this.measureGraphicsLayer.add(lengthGraphic); Will that work for you? Regards, Tom
... View more
02-18-2016
01:45 PM
|
1
|
0
|
10011
|
|
DOC
|
David, You are welcome! Thanks very much for your feedback too. Best Regards, Tom
... View more
02-18-2016
01:34 PM
|
0
|
0
|
10011
|
|
DOC
|
David, You are welcome! To change the abbreviations, you modify the string.js file located in the client\stemapp\widgets\Measure\setting\nls directory. You may need to refresh your WAB Developer browser to see changes made or restart the WAB developer session. Best Regards, Tom
... View more
02-18-2016
11:59 AM
|
1
|
0
|
10011
|
|
POST
|
Naveen, Very nice! I took your code and applied it to a map info window, added some logic to set the heading POV and updated the code to use AMD style coding. Here is my sample: <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>StreetView InfoWindow</title>
<link rel="stylesheet" href="https://js.arcgis.com/3.15/esri/css/esri.css">
<style>
html,
body,
#map {
height: 100%;
margin: 0;
padding: 0;
}
</style>
<script src="https://maps.googleapis.com/maps/api/js?key=<Your_Google_Maps_Key>&signed_in=true">
</script>
<script src="https://js.arcgis.com/3.15/"></script>
<script>
var map;
require([
"esri/map",
"dojo/dom-construct",
"dojo/domReady!"
], function(
Map, domConstruct
) {
map = new Map("map", {
basemap: "topo",
center: [-120.537, 46.592],
zoom: 17
});
map.on("load", function() {
map.infoWindow.resize(500, 300);
});
map.on("click", showStreetView);
var svNode = domConstruct.create("div", {
style: "width:480px;height:230px;margin-top:0px;display:block;overflow: auto",
innerHTML: ''
});
map.infoWindow.setContent(svNode);
function showStreetView(evt) {
var latitude = evt.mapPoint.getLatitude();
var longitude = evt.mapPoint.getLongitude();
var streetviewService = new google.maps.StreetViewService();
var svLocation = new google.maps.LatLng(latitude, longitude);
streetviewService.getPanoramaByLocation(svLocation, 200, function(result, status) {
if (status == google.maps.StreetViewStatus.OK) {
var panoLocation = result.location.latLng;
var heading = google.maps.geometry.spherical.computeHeading(panoLocation, svLocation);
var panoramaOptions = {
position: panoLocation,
pov: {
heading: heading,
pitch: 5,
zoom: 1
},
visible: true
};
var pano = new google.maps.StreetViewPanorama(svNode, panoramaOptions);
map.infoWindow.setContent(svNode);
} else {
svNode.innerHTML = "Street View is not available at this location.";
map.infoWindow.setContent(svNode);
}
map.infoWindow.setTitle("Street View - lat: " + latitude.toFixed(6) + ", lon: " + longitude.toFixed(6));
map.infoWindow.show(evt.mapPoint, map.getInfoWindowAnchor(evt.screenPoint));
});
}
});
</script>
</head>
<body>
<div id="map"></div>
</body>
</html> You can view a working sample at: StreetView InfoWindow I am not completely sure that this is within the Google Map policies, but it works... Best Regards, Tom
... View more
02-18-2016
10:51 AM
|
3
|
9
|
2769
|
|
DOC
|
Kevin, You should see a "Show Measurement Totals" checkbox just above the help button. By checking this box, it will add the summary measurements to the map. It is off by default. The triangle, circle, rectangle, ellipse and polygon produce an area and perimeter measurement. The polyline tool has a summary measurement of all vertices. If you are not seeing the checkbox, you may need to flush your browser cache. I had to do this for it to be displayed properly. Best Regards, Tom
... View more
02-17-2016
02:54 PM
|
1
|
0
|
10011
|
|
DOC
|
David, I just updated the measure widget to use the abbreviations. I thought I had added this at my last update, but obviously had forgotten. This absolutely makes sense. The previous update added a checkbox that will optionally add the summary labels. Best Regards, Tom
... View more
02-16-2016
08:54 AM
|
1
|
0
|
10011
|
|
DOC
|
Kevin, I have added a checkbox that will add the summary measurements when checked. By default it is turned off. It has been posted in the latest update to the Measure widget. Best Regards, Tom
... View more
02-12-2016
05:04 PM
|
1
|
0
|
10011
|
|
DOC
|
Ha, I found the problem with the 0.0 measurement being added on the final click. This was only showing up in Internet Explorer, but the problem occurs when starting a new segment. The angle the text was supposed to be drawn was NaN, which created an error. The other browsers were better at ignoring the error than IE. The problem has been fixed and posted in the latest update. Thanks very much for letting me know about this problem. Best Regards, Tom
... View more
02-12-2016
04:54 PM
|
0
|
0
|
10011
|
|
POST
|
Kushendra, You are welcome! Also note that if you are using a typical ArcGIS basemaps, then geodesicArea is correct. If the basemap you are using is for instance in stateplane coordinates, you should use planarArea. esri/geometry/geometryEngine | API Reference | ArcGIS API for JavaScript The first paragraph in this link gives a good explanation of which to use. Best Regards, Tom
... View more
01-28-2016
01:38 PM
|
1
|
1
|
3282
|
|
POST
|
Kushendra, I couldn't figure out a simple way to access the Shape.STArea() value. It does seem like you should be able to use it directly. Maybe someone else will have a solution. I do have a workaround for you using the geometryEngine. Call your function from the infoTemplate something like this: var infoTemplate = new InfoTemplate(
"${Name}",
calculateAcreage
); Add the function: function calculateAcreage(value) {
var sqft = geometryEngine.geodesicArea(value.geometry, "square-feet");
var squarefeet = number.format(sqft, { places: 1 });
var acres = number.format(sqft / 43560, { places: 2 });
return squarefeet + " sq.ft is equivalent to " + acres + " acres."
} I hope this helps! Regards, Tom
... View more
01-28-2016
10:33 AM
|
0
|
3
|
3282
|
|
DOC
|
David, The measure widget doesn't use the abbreviations at present. I can look into adding functionality that will allow changing and using the abbreviations to the desired preference. It also doesn't have a way to drop the area and perimeter measurements. I could look at adding checkboxes to allow you to drop those measurements from drawing. Regards, Tom
... View more
01-27-2016
08:56 AM
|
0
|
0
|
10011
|
|
POST
|
Kushendra, Yes! You specify an empty array for outFields and specify the query geometry. Something like: query.geometry = webMercatorUtils.webMercatorToGeographic(firstGraphic.geometry) query.spatialRelationship = Query.SPATIAL_REL_TOUCHES; query.outFields = []; queryTask.execute(query); Regards, Tom
... View more
01-19-2016
04:23 PM
|
1
|
2
|
1609
|
|
POST
|
Mele, They are: MODE_SNAPSHOT: 0 MODE_ONDEMAND: 1 MODE_SELECTION: 2 SELECTION_NEW: 3 SELECTION_ADD: 4 SELECTION_SUBTRACT: 5 MODE_AUTO: 6 MODE_STREAM: 7 Regards, Tom
... View more
01-05-2016
04:16 PM
|
1
|
0
|
975
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-24-2023 10:45 AM | |
| 1 | 05-19-2023 08:13 AM | |
| 1 | 02-22-2023 09:12 AM | |
| 1 | 05-15-2015 03:11 PM | |
| 1 | 02-10-2015 11:52 AM |
| Online Status |
Offline
|
| Date Last Visited |
02-26-2024
04:50 PM
|