POST
|
Hi all, I have read up on how to create use proxy pages in our application and tried it in my application but however, it did not seems to work. Can anyone help me out? I am using tomcat server. Thank you in advance.
... View more
11-14-2012
10:13 PM
|
0
|
0
|
353
|
POST
|
Hi, May I ask if it is possible to display legend for graphics/graphicslayer on the map?
... View more
11-07-2012
06:22 AM
|
0
|
1
|
569
|
POST
|
Can anyone tell me if there is any solution for getting the updated graphic after moving the graphic with the move tool of the edit toolbar?
... View more
11-01-2012
09:56 AM
|
0
|
2
|
687
|
POST
|
Hi, I am using the measurement widget in my program. However, it seems to not be able to show the results after drawing the graphics. It works only for measuring of location, measurement for distance or area does not seems to work. Please help me find my error from the codes below thank you.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<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>
Measure Tool
</title>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.8/js/dojo/dijit/themes/claro/claro.css">
<style type="text/css">
html,body {
height:100%;
width:100%;
margin:0;
}
body {
background-color:#FFF;
overflow:hidden;
font-family:"Trebuchet MS";
}
#map {
border:solid 2px #808775;
-moz-border-radius:4px;
-webkit-border-radius:4px;
border-radius:4px;
margin:5px;
padding:0px;
}
#titlePane{
width:240px;
}
.claro .dijitTitlePaneTitle {
background: #808775;
font-weight:600;
border:solid 1px #29201A;
}
.claro .dijitTitlePaneTitleHover {
background:#808775;
}
.claro .dijitTitlePaneTitleActive {
background:#808775;
}
.claro .dijitTitlePaneContentOuter {
border-right: solid 2px #808775 !important;
border-bottom: solid 2px #808775 !important;
border-left: solid 2px #808775 !important;
}
</style>
<script type="text/javascript">
djConfig = {
parseOnLoad:true
};
</script>
<!--
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.8"></script>
-->
<script type='text/javascript' src='http://www.onemap.sg/API/JS/?accessKEY=xkg8VRu6Ol+gMH+SUamkRIEB7fKzhwMvfMo/2U8UJcFhdvR4yN1GutmUIA3A6r3LDhot215OVVkZvNRzjl28TNUZgYFSswOi&v=2.8&type=full'></script>
<script type="text/javascript">
dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.TitlePane");
dojo.require("dijit.form.CheckBox");
dojo.require("esri.map");
dojo.require("esri.dijit.Measurement");
dojo.require("esri.SnappingManager");
dojo.require("esri.dijit.Scalebar");
dojo.require("esri.layers.FeatureLayer");
var map;
var OneMap = new GetOneMap('map','SM');
function init() {
//This sample may require a proxy page to handle communications with the ArcGIS Server services. You will need to
//replace the url below with the location of a proxy on your machine. See the 'Using the proxy page' help topic
//for details on setting up a proxy page.
//esri.config.defaults.io.proxyUrl = "/arcgisserver/apis/javascript/proxy/proxy.ashx";
//esri.config.defaults.io.alwaysUseProxy = false;
//This service is for development and testing purposes only. We recommend that you create your own geometry service for use within your applications
//esri.config.defaults.geometryService = new esri.tasks.GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
esri.config.defaults.geometryService = new esri.tasks.GeometryService("http://www.onemap.sg/ArcGIS/rest/services/Geometry/GeometryServer");
//var initialExtent = new esri.geometry.Extent({"xmin":-9545482,"ymin":4615382,"xmax":-9544248,"ymax":4616059,"spatialReference":{"wkid":102100}});
//map = new esri.Map("map", {
//extent:initialExtent
// });
dojo.connect(OneMap.map, 'onLoad', function(map) {
//resize the map when the browser resizes
dojo.connect(dijit.byId('map'), 'resize', map,map.resize);
});
/*var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer");
map.addLayer(basemap);
var sfs = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,
new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,
new dojo.Color([195,176,23]), 2),null);
var parcelsLayer = new esri.layers.FeatureLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_LandRecords_Louisville/MapServer/0", {
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
outFields: ["*"]
});
parcelsLayer.setRenderer(new esri.renderer.SimpleRenderer(sfs));
dojo.connect(map, "onLayersAddResult", function(results){
//dojo.keys.copyKey maps to CTRL on windows and Cmd on Mac.
var snapManager = map.enableSnapping({snapKey:dojo.keys.copyKey});
var layerInfos = [{layer: parcelsLayer}];
snapManager.setLayerInfos(layerInfos);*/
var measurement = new esri.dijit.Measurement({
map: OneMap.map
}, dojo.byId('measurementDiv'));
measurement.startup();
//});
//map.addLayers([parcelsLayer]);
}
//show map on load
dojo.addOnLoad(init);
</script>
</head>
<body class="claro">
<div id="mainWindow" data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design:'headline',gutters:'false'"
style="width:100%; height:100%;">
<div id="map" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'">
<div style="position:absolute; right:20px; top:10px; z-Index:999;">
<div id="titlePane" data-dojo-type="dijit.TitlePane" data-dojo-props="title:'Measurement', closable:'false', open:'false'">
<div id="measurementDiv"></div>
<span style="font-size:smaller;padding:5px 5px;">Press <b>CTRL</b> to enable snapping.</span>
</div>
</div>
</div>
</div>
</body>
</html>
... View more
10-29-2012
02:01 AM
|
0
|
1
|
788
|
POST
|
Is there any way to insert maps of different coordinate systems into basemap gallery? Like for example: maps: http://www.onemap.sg/ArcGIS/rest/services/BASEMAP/MapServer (SVY21) & Bingmap - Aerial Map View
... View more
10-25-2012
02:03 AM
|
0
|
0
|
469
|
POST
|
Hi, Is there any way whereby I can create kml file with graphics using javascript so that I can use the kml file as the url parameter of the KMLLayer?
... View more
10-21-2012
05:49 PM
|
0
|
0
|
569
|
POST
|
Primitive arguments in JavaScript are passed by value so in your code nIndex will always be zero, hence your infinite loop. Are you getting this from a RouteTask? You know that this is decompressed for you in the RouteResult etc? Hi, thanks for your help. I managed to solve it.
... View more
10-15-2012
11:32 PM
|
0
|
1
|
1550
|
POST
|
Maybe....you could do a little research, find out what a "Path" (in that context) is and then relate it to the classes available in the JS API. Here's somewhere to start: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/002m/002m0000045n000000.htm Which might lead you to: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/polyline.htm#addPath Hi can you please help me check if there is anything wrong with my codes?It keep looping on stage 3 and 4 non-stop. Below is the code snippets that I have converted in javascript.
function check(){
alert("stage 1");
//alert("\nCompressed geometry with no Ms, no Zs:");
//PrintPath(CreatePathFromCompressedGeometry("+1m91-6fkfr+202tp+k+f+7+3+34+2d"));
//alert("\nCompressed geometry with both Ms, Zs:");
//PrintPath(CreatePathFromCompressedGeometry("+0+1+3+1+emjd+3j07m+3+0+0+1-3-1|+9og+0+lv4+0+lv4|+5rg+uq+r9+au+168"));
PrintPath(CreatePathFromCompressedGeometry("+1+hrt+139j+0+0"));
}
function PrintPath(pth){
alert("stage 5");
//alert(pth);
for (i = 0; i < pth.length; i++){
var p = pth;
alert(p);
//PointN p = pth.PointArray as PointN;
//alert(p.x + ",\t" + p.y);
}
}
function CreatePathFromCompressedGeometry(compresedGeometry){
alert("stage 2");
var points = [];
var nIndex = 0;
var dMultBy = parseFloat(ExtractInt(compresedGeometry, nIndex)); // exception
var nLastDiffX = 0;
var nLastDiffY = 0;
var nLength = compresedGeometry.length; // reduce call stack
while (nIndex != nLength) {
// extract number
var nDiffX = ExtractInt(compresedGeometry, nIndex); // exception
var nDiffY = ExtractInt(compresedGeometry, nIndex); // exception
// decompress
var nX = nDiffX + nLastDiffX;
var nY = nDiffY + nLastDiffY;
var dX = parseFloat(nX / dMultBy);
var dY = parseFloat(nY / dMultBy);
// add result item
var point = new esri.geometry.Point(dX, dY, new esri.SpatialReference({ wkid: 3414 }));
//point.x = dX;
//point.y = dY;
points.push(point); // memory exception
// prepare for next calculation
nLastDiffX = nX;
nLastDiffY = nY;
}
return points;
}
function ExtractInt(src, nStartPos) {
alert("stage 3");
// Read one integer from compressed geometry string by using passed position
// Returns extracted integer, and re-writes nStartPos for the next integer
var bStop = false;
var result = "";
var nCurrentPos = nStartPos;
while (!bStop) {
var cCurrent = src[nCurrentPos];
if (cCurrent == '+' || cCurrent == '-' || cCurrent == '|') {
if (nCurrentPos != nStartPos) {
bStop = true;
continue;
}
}
result += cCurrent;
nCurrentPos++;
if (nCurrentPos == src.length) // check overflow
bStop = true;
}
var nResult = 0;
if (result.length != 0) {
nResult = FromStringRadix32(result.toString());
nStartPos = nCurrentPos;
}
return nResult;
}
function FromStringRadix32(s) {
alert("stage 4");
// Sample input and output: +1lmo -> 55000
var result = 0;
for (i = 1; i < s.length; i++) {
var cur = s;
//Assert.IsTrue((cur >= '0' && cur <= '9') || (cur >= 'a' && cur <= 'v'), "Cannot parse CompressedGeometry");
if (cur >= '0' && cur <= '9')
result = (result << 5) + parseInt(cur) - parseInt('0');
else if (cur >= 'a' && cur <= 'v')
result = (result << 5) + parseInt(cur) - parseInt('a') + 10;
//else Assert.Fail("Cannot parse CompressedGeometry");
}
if (s[0] == '-')
result = -result;
return result;
}
... View more
10-12-2012
10:36 PM
|
0
|
0
|
1550
|
POST
|
That why I said you'd have to port it, i.e. from C# to JavaScript. Have you looked at the code? It's not that complicated. Ya I have seen the codes inside the file. They have something called the Path inside. What do I change the Path to? Polyline?
... View more
10-11-2012
06:42 PM
|
0
|
0
|
1550
|
POST
|
Is there any sources in javascript? I need it in javascript as all my codes are in javascript and html. I am not using C#.
... View more
10-10-2012
04:51 PM
|
0
|
0
|
1550
|
POST
|
[ATTACH=CONFIG]18312[/ATTACH] Above shows a route with a javascript alertbox with the features of each of the segments of the routes. There is also a compressedGeometry in it. Is there any way to decode/decompress the compressedGeometry?
... View more
10-10-2012
12:11 AM
|
0
|
9
|
4160
|
POST
|
Hi, I am trying to develop an android map application for my school project using the onemap. I had declared a mapView in my xml layout file and in my Activity java file, i add the onemap service as a layer to the mapView. But the layer that i have added only covers partial part of the android emulator screen, so I tried to use the zoomin method to see if the layer will cover a larger portion of the screen but nevertheless, it is still the same. Please help me see my codes to help me identify my errors and sorry for my bad english. Below attached are my codes for xml layout file, Activity class and also the display on my emulator. [ATTACH=CONFIG]14954[/ATTACH]
/* TtActivity.java */
package com.nyp;
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.*;
import com.esri.android.map.LocationService;
import com.esri.android.map.MapView;
import com.esri.android.map.ags.ArcGISDynamicMapServiceLayer;
import com.esri.core.symbol.SimpleMarkerSymbol;
import com.esri.core.symbol.SimpleMarkerSymbol.STYLE;
public class TtActivity extends Activity {
MapView mMapView;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Retrieve the map and initial extent from XML layout
mMapView = (MapView) findViewById(R.id.map);
mMapView.addLayer(new ArcGISDynamicMapServiceLayer("http://www.onemap.sg/ArcGIS/rest/services/BASEMAP/MapServer"));
mMapView.zoomin();
}
@Override
protected void onDestroy() {
super.onDestroy();
}
@Override
protected void onPause() {
super.onPause();
mMapView.pause();
}
@Override
protected void onResume() {
super.onResume();
mMapView.unpause();
}
}
[HTML] <!-- main.xml --> <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <!-- MapView layout and initial extent --> <com.esri.android.map.MapView android:id="@+id/map" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </LinearLayout> [/HTML]
... View more
06-05-2012
10:03 AM
|
0
|
1
|
2363
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|