Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Java script
hi.......
 
i have drawn some area in a map and giving some name to that area saved in data base.now iam getting that name into dropdownlist and i want to display that drawn area into map when click that name.plz help me..
Posted 27-Feb-12 20:39pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Get the longutide and latitude coordinates from your database, and the zoom level. Place those data into their respective positions of the URL.
  Permalink  
Comments
rajasekhar57 at 28-Feb-12 6:44am
   
I think this code for getting the particular area where u want
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAnfs7bKE82qgb3Zc2YyS-oBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSySz_REpPq-4WZA27OwgbtyR3VcA&sensor=false">
type="text/javascript"></script>
</head>
<body>
<form id="form1" runat="server">
<script type="text/javascript">
var locations = [['Bondi Beach', -33.890542, 151.274856], ['Coogee Beach', -33.923036, 151.259052], ['Cronulla Beach', -34.028249, 151.157507], ['Manly Beach', -33.800128, 151.282085], ['Maroubra Beach', -33.950198, 151.259302]];
var map = new GMap2(document.getElementById('map'));
var i; map.setCenter(new GLatLng(-33.92, 151.25), 10);
for (i = 0; i < locations.length; i++)
{
var marker = new GMarker(new GLatLng(locations[i][1], locations[i][2]));
map.addOverlay(marker);
GEvent.addListener(marker, "click", function ()
{
marker.openInfoWindowHtml("hi");
});
}
</script>
</form>
</body>
</html>
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

<html xmlns="http://www.w3.org/1999/xhtml">
<head   runat="server">
      <title></title>
      <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAnfs7bKE82qgb3Zc2YyS-oBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSySz_REpPq-4WZA27OwgbtyR3VcA&sensor=false"
            type="text/javascript"></script>
</head>
<body>
      <form id="form1"   runat="server">
      <div id="map" style="width: 500px; height: 400px;"></div>
      <script type="text/javascript">
            var locations = [['Bondi Beach', -33.890542, 151.274856], ['Coogee Beach', -33.923036, 151.259052], ['Cronulla Beach', -34.028249, 151.157507], ['Manly Beach', -33.800128, 151.282085], ['Maroubra Beach', -33.950198, 151.259302]];
            var map = new GMap2(document.getElementById('map'));
            var i; map.setCenter(new GLatLng(-33.92, 151.25), 10);
            for (i = 0; i < locations.length; i++)
            {
                  var marker = new GMarker(new GLatLng(locations[i][1], locations[i][2]));
                  map.addOverlay(marker);
                  GEvent.addListener(marker, "click", function ()
                  {
                        marker.openInfoWindowHtml("hi");
                  });                                      
            }
         </script>
      </form>
</body>
</html>
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 George Jonsson 175
1 Kornfeld Eliyahu Peter 169
2 Zoltán Zörgő 139
3 PIEBALDconsult 130
4 OriginalGriff 120
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,107
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,342


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 28 Feb 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100