Example #1
0
        //generates the url for the map request
        public string generateMap(Map map)
        {
            string str;
            string start = "http://maps.google.com/maps/api/staticmap?";

            str = start;

            if (!map.getCenter().Equals("-1"))
            {
                str += "center=" + map.getCenter() + "&";
            }

            if (!map.getZoom().Equals("-1"))
            {
                str += "zoom=" + map.getZoom() + "&";
            }

            if (!map.getSize().Equals("-1"))
            {
                str += "size=" + map.getSize() + "&";
            }

            if (!map.getMapType().Equals("-1"))
            {
                str += "maptype=" + map.getMapType() + "&";
            }

            if (!(map.getMarkers().Count == 0))
            {
                int count = map.getMarkers().Count;

                for (int i = 0; i < count; i++)
                {
                    str += "markers=" + map.getMarkers()[i] + "&";
                }
            }

            if (!map.getMobile().Equals("-1"))
            {
                str += "mobile=" + map.getMobile() + "&";
            }

            str += "sensor=" + map.getSensor();

            return(str);
        }