Click here to Skip to main content
15,904,287 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
JavaScript
<script type="text/javascript">
        $(function () {
            $("#btnShow").click(function () {
                var geoLocation = document.getElementById('geoLocation123').value;
                temp = geoLocation.split(",");
                //alert(temp[0]);
                //alert(temp[1]);
                //alert(geoLocation);
                $("#dialog").dialog({
                    modal: true,
                    title: "Google Map",
                    width: 600,
                    height: 450,
                    buttons: {
                        Close: function () {
                            $(this).dialog('close');
                        }
                    },
                    open: function () {
                        var mapOptions = {
                            center: new google.maps.LatLng(temp[0], temp[1]),
                            zoom: 10,
                            mapTypeId: google.maps.MapTypeId.ROADMAP
                        }
                        var map = new google.maps.Map($("#dvMap")[0], mapOptions);
                    }
                });
            });
        });
    </script>
Posted
Updated 15-Oct-15 22:30pm
v2

 
Share this answer
 
XML
// map placement
<div id="map_canvas" style="width: 100%; height: 100%;">
</div>

// your google map api get and javascript
        <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
//function to show 
        <script type="text/javascript">

            $(document).ready(function () {
                initialize();
            });
            function initialize() {
                //Place your google point on the map
                var mapOptions = {
                    center: new google.maps.LatLng(51.9310008, 6.115906),
                    zoom: 10,
                    mapTypeId: google.maps.MapTypeId.ROADMAP
                };
                var map = new google.maps.Map(document.getElementById("map_canvas"),
                  mapOptions);
                // create a marker
                var latlng = new google.maps.LatLng(51.9310008, 6.115906);
                
                // placement of marker
                var marker = new google.maps.Marker({
                    position: latlng,
                    label: "label",
                    labelContent: "labelcontent",
                    map: map,
                    title: 'title'
                });
                
                //create your map info
                var iw1 = new google.maps.InfoWindow({
                    content: "content"
                });
                // create your click handler for clicking point on you google map to show your marker content
                google.maps.event.addListener(marker, "click", function (e) { iw1.open(map, this); });
            }


Additional infromation: You are not allowed to save the google map latling locations in a database!! you must use a third party software to get your latling location in a database use something like a zip adress finder api to get latinglocations and save them to a database.
 
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