Solved

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

Posted on 2010-09-05
4
1,897 Views
Last Modified: 2012-05-10
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
Comment
Question by:palserv
4 Comments
 
LVL 3

Assisted Solution

by:AndyEastham
AndyEastham earned 250 total points
Comment Utility
Hi,

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

Andy
0
 
LVL 13

Accepted Solution

by:
Molnar István earned 250 total points
Comment Utility
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
 

Author Comment

by:palserv
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now