POST
|
My sincerest thanks! That helped immensely. Now I can work on creating a custom graphic and trying to dynamically read in values from another data source. You are truly a credit to the development community. Thanks again.
... View more
05-24-2011
09:44 AM
|
0
|
0
|
866
|
POST
|
Thank you very much that was extraordinarily helpful. I have a few questions if I may. I am still having trouble getting the point to appear on the map. Are there any require statements that are required with the code you provided? (dojo.require(stuff)); Similarly I presently do not have an 'OnLoad' function in my code. Is this a function that is already build into the esri map? Using the code as you described with xy coordinate (-100,40) where would that point appear on the map? In the ArcGIS documentation they indicate these coordinates are 'map units'. Is this different from true latitude and longitude? Again I am new to this realm so I apologize if my queries are elementary. Here is a look at my code... <head id="Head1" runat="server">
<title>Untitled Page</title>
<script src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.3" type="text/javascript"></script>
<link href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.3/js/dojo/dijit/themes/claro/claro.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
dojo.require("esri.map");
var map;
function init() {
var initExtent = new esri.geometry.Extent({"xmin":-10427539.398660975,"ymin":5592973.796653195,"xmax":-10358746.073204407,"ymax":5638836.013624239,"spatialReference":{"wkid":102100}});
map = new esri.Map("mapDiv",{extent:initExtent});
var basemapURL= "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
var basemap = new esri.layers.ArcGISTiledMapServiceLayer(basemapURL);
map.addLayer(basemap);
}
dojo.addOnLoad(init);
dojo.connect(map, 'onLoad', function() {
var pt = new esri.geometry.Point(-118.15, 33.80, new esri.SpatialReference({ 'wkid': 4326 }));
map.graphics.add(new esri.Graphic(
esri.geometry.geographicToWebMercator(pt), // geometry
new esri.symbol.SimpleMarkerSymbol(), // symbol
{ 'title': 'Test Point Location', 'content': 'This is content' }, // attributes
new esri.InfoTemplate('${title}', '${content}')
));
});
</script>
</head>
Thank you for your help again.
... View more
05-24-2011
06:03 AM
|
0
|
0
|
866
|
POST
|
I am trying to integrate an esri map into our companies webpage as part of a proof oc concept for a future project. I am trying to add a simple marker to a map using the XY coordinate we have stored in a DB. Most of the information I have found relates to SilverLight, VB. I am using C# in vs 2005. Can someone point me in the right direction as to how/where to get started? I am a bit new to this technology (mapping, ARCGIS) so forgive my naivete in advance and please tell me any info I missing. Here is the code I have for my basic map: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestBaseMap.aspx.cs" Inherits="OnDemand.Pages.TestBaseMap" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> <script src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.3" type="text/javascript"></script> <link href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.3/js/dojo/dijit/themes/claro/claro.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> dojo.require("esri.map"); var map; function init() { map = new esri.Map("mapDiv"); var basemapURL= "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" var basemap = new esri.layers.ArcGISTiledMapServiceLayer(basemapURL); map.addLayer(basemap); } dojo.addOnLoad(init); </script> </head> <body> <form id="form1" runat="server"> <div id="mapDiv" style="width:900px; height:600px; border:1px solid #000;"></div> </form> </body> </html> All I would like to be able to do is add a pin/marker to the map with a popup displaying the coordinate info. Any suggestions would be appreciated. Thank you very much.
... View more
05-23-2011
09:22 AM
|
0
|
6
|
13466
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|