Click here to Skip to main content
15,879,326 members
Articles / Web Development / ASP.NET

MDI style web app using VisualJS.NET and Google Maps API

Rate me:
Please Sign up or sign in to vote.
4.50/5 (2 votes)
5 Oct 2012CPOL2 min read 18.9K   18   7  
RAD sample of MDI style web app using VisualJS.NET with Google Maps.

This article appears in the Third Party Products and Tools section. Articles in this section are for the members only and must not be used to promote or advertise products in any way, shape or form. Please report any spam or advertising.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="VisualJS.NET_GoogleMaps_sample.VisualJSApp.VSJS_SamplePage" %>

<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Sample Page</title>
    <link rel="shortcut icon" href="http://www.visualjs.net/favicon.ico" />
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <meta content="text/javascript" http-equiv="Content-Script-Type" />
    <meta content="text/css" http-equiv="Content-Style-Type" />
    <meta id="MetaDescription" name="DESCRIPTION" content="VisualJS.NET Web Application" />
    <meta id="MetaCopyright" name="COPYRIGHT" content="Copyright 2012 zondig!" />
    <meta id="MetaAuthor" name="AUTHOR" content="VisualJS.NET" />
    <!-- Useful settings for mobile browsers -->
    <meta name="viewport" content="initial-scale=1.0;maximum-scale=1.0; user-scalable=no;" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="HandheldFriendly" content="true" />
    <!-- <link href='/VisualJSApp/Style/CustomStyle.css' media='screen' rel='stylesheet' type='text/css' /> -->
    <link href='a.PokeIn?name=VSJS_CSS&type=text' media='screen' rel='stylesheet' type='text/css' />
    <!--VisualJS Script Library Codes.-->
    <script type='text/javascript' src='b.PokeIn?name=VSJS_JSS&type=text' charset='UTF-8'></script>
    <!--VisualJS Connection Routine.-->
    <script type="text/javascript" src="c.PokeIn?VisualJS=1&rnd=<%=DateTime.Now.Millisecond.ToString()%>"></script>
    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=true">
    </script>
    <script type="text/javascript">
        var maps = new Array();
        var geocoder;        

        function initialize(windowNumber) {
            geocoder = new google.maps.Geocoder();
            var mapOptions = {
                center: new google.maps.LatLng(-34.397, 150.644),
                zoom: 8,
                mapTypeId: google.maps.MapTypeId.ROADMAP,
                disableDefaultUI: true
            };

            maps[windowNumber] = new google.maps.Map(document.getElementById("map_canvas" + windowNumber), mapOptions);
        }

        function FindLocation(location, windowNumber) {
            var map = maps[windowNumber];
            geocoder.geocode({ 'address': location }, function (results, status) {
                if (status == google.maps.GeocoderStatus.OK) {
                    map.setCenter(results[0].geometry.location);
                    var marker = new google.maps.Marker({
                        map: map,
                        position: results[0].geometry.location
                    });
                }
                else {
                    alert("Geocode was not successful for the following reason: " + status);
                }
            });
        }
    </script>
</head>
<body>
    <script type="text/javascript">
        //VisualJSLoaded event handler
        document.VisualJSLoaded = function () {
            //Show the MainForm
            VSJS.GMapsSampleForm.Show();

            //Form OnClose Event
            VSJS.GMapsSampleForm.OnClose = function () {
                if (PokeIn.IsConnected) {
                    PokeIn.Close();
                };
                if (!PokeIn.PageUnloading) {
                    setTimeout(PokeIn.ReConnect, 500);
                };
            };
            initialize(0);                       
        };
    </script>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

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


Written By
Software Developer
Poland Poland
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions