Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

what am trying to do is, i have data in database
for example
Database table
Name       : Jack     
mob_number : 445452454             
address    : al saada street    
country    :  dubai


In my view

@item.Name
@item.address
@item.country

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
XML
<script type="text/javascript">
                function initialize() {
                    var latlng = new google.maps.LatLng(40.716948, -74.003563);
                    var options = {
                        zoom: 14,
                        center: latlng,
                        mapTypeId: google.maps.MapTypeId.ROADMAP
                    };
                    var map = new google.maps.Map(document.getElementById("map"), options); 
                }

                initialize();
            </script>


Problem is

#1) How to pass @item.address to google map for search location ?
Posted

1 solution

Follow these links :

http://www.wikihow.com/Geocode-an-Address-in-Google-Maps-Javascript[^]

http://www.chautauquahomes.us/wikihow/geocode/default.aspx[^]


Implementation :

http://www.ceat.com/locator.aspx[^]

Click on "Detect Location" button.

You need to pass the address string to Gmaps to get the address.

Refer the function codeAddress(addrString) in JS section.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900