• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2090
  • Last Modified:

how to add point to gis map using asp.net c#

Hello,
I have this case ,
- I have asp.net c# web  application stores information about Incidents including the coordinates of that indecent The XY that he already taken by a GPS device ,all these info. is stored in sql server 2008 DB

what I want is to plot that XY point on the map with some info on it ,
the map should be web application too  

what I have : - ArcGis server 9.3.1 (installed )
                         ArcGis desktop 9.3 (installed )
                         ArcSde 9.2 (installed and successfully connected with sql server)
                         MS VS.NET 2008 (installed )
                        Sql server 2008 (installed on a remote machine )

the question is how to accomplish that , what is the steps should I walk through ?
thanks in advance  
0
palserv
Asked:
palserv
2 Solutions
 
AndyEasthamCommented:
Hi,

Have you considered doing this with the Google Earth API?
http://code.google.com/apis/earth/

Andy
0
 
Molnar IstvánHelpDesk / ProgrammerCommented:
i didn't work with arcgis, but here is some idea how you can accomplish that in google map:
a.) you can use google map api
1. retrieve data from the database with asp.net (c#)
2. after you get the data from the database, create some variables for X and Y coordinates in C# and add the data from the database to these variables
3. pass these server variables to javascript which contains the coords
    (ex: java script:
                               var ClientVariableX = '<%= ServerVaraibleX %>';
                                var ClientVariableY = '<%= ServerVaraibleY %>';)
4. create markers with info window from the x, y data in google map
(see JS code below))
5. add the JS in the body of page
b.) you can use for free the Subgurim google map asp.net user control http://en.googlemaps.subgurim.net/ to accomplish the above

if you deside to use google map, here is a good starting site with many useful examples:
http://econym.org.uk/gmap/

hope it helps you
<script type="text/javascript">

    var ClientVariableLat = '<%= ServerVaraibleLat %>';
    var ClientVariableLng = '<%= ServerVaraibleLng %>';
    
    if (GBrowserIsCompatible()) 
    { 

      function createMarker(point,html) 
      {
        var marker = new GMarker(point);
        GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(html);});
        return marker;
      }

      var map = new GMap2(document.getElementById("map"));
      map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());
      map.setCenter(new GLatLng(43.907787,-79.359741),8); //set the initial location
    

      var point = new GLatLng(ClientVariableLat,ClientVariableLng);
      var marker = createMarker(point,'write here some stuff to display in the info Window')
      map.addOverlay(marker);

    }
    
    // display a warning if the browser was not compatible
    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }

    </script>

Open in new window

0
 
palservAuthor Commented:
I appreciate your help , but the institution I work for is using ArcGis software and have its own maps and gis database , so google maps doesn't apply my needs

thanks
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now