Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Thejesh GN
committed
May 15, 2010
0 parents
commit b8cc7ae
Showing
5 changed files
with
773 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<!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" /> | ||
<title>Janaggraha</title> | ||
|
||
<!--ArcGis Server API--> | ||
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/1.6/js/dojo/dijit/themes/tundra/tundra.css"> | ||
|
||
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=1.6"></script> | ||
<script type="text/javascript" src="api-markers.js"></script> | ||
|
||
<script type="text/javascript" > | ||
var marker_results1 = {"results": [ | ||
|
||
|
||
{ | ||
"name": "Discussions", | ||
"desc": "Lalbagh metro tree cutting", | ||
"long": 1474240.433, | ||
"lat": -528040.405 | ||
}, | ||
|
||
{ | ||
"name": "Stop metro event", | ||
"desc": "Lalbagh metro tree cutting", | ||
"long": 1474241.433, | ||
"lat": -528041.405 | ||
} | ||
] | ||
}; | ||
|
||
|
||
var marker_results2 = {"results": [ | ||
{ | ||
"name": "Event", | ||
"desc": "my results, go to <a href='http://ijanaagraha.org/blog'>some link</a>", | ||
"long": 1464006.0021466203, | ||
"lat": -538083.3186863576 | ||
}, | ||
{ | ||
"name": "Blog", | ||
"desc": "my questions", | ||
"long": 1460061.938702938, | ||
"lat": -519151.81415668206 | ||
} | ||
] | ||
}; | ||
|
||
var marker_results3 = {"results": [ | ||
|
||
|
||
{ | ||
"name": "Stop metro event", | ||
"desc": "Lalbagh metro tree cutting", | ||
"lat": -539660.9440638305, | ||
"long": 1463118.5878717918 | ||
} | ||
] | ||
}; | ||
|
||
|
||
var j1 = new janaagrahaMaps(); | ||
var j2 = new janaagrahaMaps(); | ||
//var j3 = new janaagrahaMaps(); | ||
|
||
function start(){ | ||
j1.initialize("mapDiv1",marker_results1); | ||
j2.initialize("mapDiv2",marker_results2); | ||
//j3.initialize("mapDiv3",marker_results3); | ||
} | ||
|
||
dojo.addOnLoad(start); | ||
|
||
|
||
</script> | ||
|
||
</head> | ||
<body class="tundra"> | ||
|
||
<div id="mapDiv1" style="width:600px; height:600px; border:1px solid #000; visibility: hidden;" ></div> | ||
|
||
<div id="mapDiv2" style="width:800px; height:600px; border:1px solid #000; visibility: hidden;" ></div> | ||
|
||
<div id="mapDiv3" style="width:600px; height:600px; border:1px solid #000; visibility: hidden;" ></div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
dojo.require("esri.map"); | ||
dojo.require("esri.tasks.identify"); | ||
dojo.require("dijit.layout.ContentPane"); | ||
|
||
function janagrahaMapGod(size){ | ||
|
||
this.mapIds=[]; | ||
this.dataIds=[]; | ||
this.size=0; | ||
this.add = add; | ||
|
||
function add(mapid, dataid){ | ||
mapIds[size]=mapid; | ||
dataIds[size]=dataid; | ||
size=size+1; | ||
} | ||
|
||
} | ||
|
||
function janaagrahaMaps(){ | ||
|
||
this.divid; | ||
var marker_results; | ||
|
||
var map; | ||
var identifyTask; | ||
var identifyParams; | ||
var symbol; | ||
var layer2results; | ||
var layer3results; | ||
var layer4results; | ||
var toolBar; | ||
var zoomExtent; | ||
this.begin = begin; | ||
this.initialize = initialize; | ||
this.initFunctionality = initFunctionality; | ||
this.graphicsOnClick = graphicsOnClick; | ||
this.markerProcessor= markerProcessor; | ||
this.showId = showId; | ||
|
||
function log(x){ | ||
//console.log(this.divid,x); | ||
} | ||
|
||
function showId(){ | ||
return divid; | ||
} | ||
|
||
|
||
function initialize(id,markers) { | ||
this.divid=id; | ||
map = null; | ||
zoomExtent = null; | ||
identifyTask= null; | ||
identifyParams= null; | ||
symbol= null; | ||
layer2results= null; | ||
layer3results= null; | ||
layer4results= null; | ||
toolBar = null; | ||
marker_results = markers; | ||
log("initialize="+map); | ||
log(map); | ||
if (map == null) { | ||
document.getElementById(this.divid).style.visibility = 'visible'; | ||
//dojo.addOnLoad(begin); | ||
this.begin(); | ||
} | ||
|
||
} | ||
|
||
function begin() { | ||
log('begin='+this.divid); | ||
map = new esri.Map(this.divid, {}); | ||
//var imageryPrime = new esri.layers.ArcGISTiledMapServiceLayer("http://10.10.10.133/ArcGIS/rest/services/Ij_Final/MapServer"); | ||
//var imageryPrime = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"); | ||
var imageryPrime = new esri.layers.ArcGISDynamicMapServiceLayer("http://maps.ijanaagraha.org/ArcGIS/rest/services/IJ/MapServer"); | ||
map.addLayer(imageryPrime); | ||
esriConfig.defaults.map.slider = { left: "10px", top: "0px", width: null, height: "30px" }; | ||
log('begin2='+map); | ||
dojo.connect(map,"onLoad", initFunctionality); | ||
} | ||
|
||
|
||
|
||
|
||
function initFunctionality() { | ||
log("initFunctionality"); | ||
dojo.connect(map.graphics, "onClick", graphicsOnClick); | ||
markerProcessor(); | ||
} | ||
|
||
|
||
// GRAPHIC ON CLICK | ||
function graphicsOnClick(evt){ | ||
// debugger | ||
// GRAPHIC | ||
var graphic = evt.graphic; | ||
|
||
// SET INFOWINDOW SIZE | ||
map.infoWindow.resize(160, 125); | ||
// SET INFOWINDOW TITLE | ||
var titleTemplate = graphic.titleField + ': ${' + graphic.titleField + '}'; | ||
map.infoWindow.setTitle(graphic.attributes.Name); | ||
// ATTRIBUTE GRID NODE | ||
var gridNode = dojo.doc.createElement('div'); | ||
var content = "<b> Name:</b>" | ||
+ graphic.attributes.Name + "<br/><b> Description:</b>" | ||
+ graphic.attributes.Description + "<br/>"; | ||
//content = content+"<b>Lat:</b>" + graphic.geometry.x + "<br/><b>Long:</b>" + graphic.geometry.y + "<br/>"; | ||
map.infoWindow.setContent(content); | ||
|
||
// SET INFOWINDOW LOCAITON | ||
var mapPnt = (graphic.geometry.type == 'point') ? graphic.geometry : graphic.geometry.getExtent().getCenter(); | ||
var scrPnt = map.toScreen(mapPnt); | ||
map.infoWindow.show(scrPnt, map.getInfoWindowAnchor(scrPnt)); | ||
|
||
} | ||
|
||
|
||
function markerProcessor() { | ||
log("markerProcessor"+marker_results["results"].length); | ||
|
||
for (var i = 0; i<marker_results["results"].length; i++) { | ||
var attributes = { Name: marker_results["results"][i]["name"], lat: marker_results["results"][i]["lat"],lon: marker_results["results"][i]["long"], Description: marker_results["results"][i]["desc"] }; | ||
|
||
log("Adding= lat="+marker_results["results"][i]["lat"]+",lon="+marker_results["results"][i]["long"]); | ||
|
||
var location = new esri.geometry.Point(marker_results["results"][i]["lat"], marker_results["results"][i]["long"]); | ||
var markerSymbol = new esri.symbol.PictureMarkerSymbol('button-06.gif', 22, 22); | ||
var graphic = new esri.Graphic(location, markerSymbol, attributes); | ||
graphic.titleField = "Event"; | ||
map.graphics.add(graphic); | ||
//alert(map.spatialReference.wkid); | ||
var extentGeom = new esri.geometry.Multipoint(map.spatialReference); | ||
extentGeom.addPoint(location); | ||
if (zoomExtent == null) { | ||
zoomExtent = extentGeom.getExtent(); | ||
} | ||
else { | ||
zoomExtent = zoomExtent.union(extentGeom.getExtent()); | ||
} | ||
log("zoomExtent="+zoomExtent); | ||
log("next"); | ||
} | ||
log("done"); | ||
map.setExtent(zoomExtent); | ||
} | ||
|
||
} | ||
|
||
|
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
<!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" /> | ||
<title>QueryTask with geometry, results as an InfoWindow</title> | ||
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/1.6/js/dojo/dijit/themes/tundra/tundra.css"> | ||
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/1.6/js/dojo/dojox/grid/resources/Grid.css"> | ||
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/1.6/js/dojo/dojox/grid/resources/tundraGrid.css"> | ||
|
||
<script type="text/javascript"> | ||
djConfig = { | ||
parseOnLoad:true | ||
} | ||
</script> | ||
|
||
|
||
|
||
<script type="text/javascript">djConfig = { parseOnLoad:true }</script> | ||
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=1.6"></script> | ||
<script type="text/javascript"> | ||
var type="MarkMyLocation"; | ||
//var type="MarkAnyLocation"; | ||
var field_mapping = {"mapping": [ | ||
|
||
|
||
{ | ||
"lat": "field_lat", | ||
"long": "field_long", | ||
"ac": "field_ac", | ||
"ward": "field_ward" | ||
} | ||
] | ||
}; | ||
|
||
</script> | ||
|
||
<script type="text/javascript" src="api-search-mark.js"></script> | ||
|
||
</head> | ||
<body class="tundra"> | ||
<div style="width: 600px; height: 30px; border: 1px solid #000;" align="center"> | ||
Serach/Mark My Loaction/ Mark Any Location | ||
</div> | ||
<div id="mp" > | ||
<input type="radio" name="serachtype" id="s1" onclick="changeSelect(this);">By Pincode/Locality/Road</input> | ||
<table id="parm" style=""> | ||
<tr> | ||
<td> | ||
Pin code | ||
</td> | ||
<td> | ||
<input type="text" id="pin" style="width: 100px;" /> | ||
</td> | ||
<td> | ||
Locality | ||
</td> | ||
<td> | ||
<input type="text" id="locality" style="width: 100px;" /> | ||
</td> | ||
<td> | ||
Road | ||
</td> | ||
<td> | ||
<input type="text" id="road" style="width: 100px;" /> | ||
</td> | ||
</tr> | ||
</table> | ||
<input type="radio" name="serachtype" id="s2" onclick="changeSelect1(this);">By Landmark/Area</input> | ||
<table id="parm1"> | ||
<tr> | ||
<td> | ||
Land Mark | ||
</td> | ||
<td> | ||
<input type="text" id="landmark" style="width: 100px;" /> | ||
</td> | ||
|
||
<td> | ||
Area | ||
</td> | ||
<td> | ||
<input type="text" id="Area" style="width: 100px;" /> | ||
</td> | ||
|
||
</tr> | ||
|
||
</table> | ||
<input type="button" id="btnSearch" value="Search" onclick="executeQueryTask();" | ||
|
||
/> | ||
|
||
<div id="mapDiv" style="width: 600px; height: 400px; border: 1px solid #000;"> | ||
</div> | ||
|
||
Lat:<input type="text" id="field_lat" style="width: 100px;" /> | ||
Long:<input type="text" id="field_long" style="width: 100px;" /> | ||
AC:<input type="text" id="field_ac" style="width: 100px;" /> | ||
WARD:<input type="text" id="field_ward" style="width: 100px;" /> | ||
|
||
|
||
</body> | ||
</html> |
Oops, something went wrong.