浏览: 日期:2020-06-10
Almost everybody who has access to the Internet knows Google as one of the most reliable search engines in the World Wide Web. In the past few years Google has developed many useful services like Google mail and Google API (Application Program Interface). In this project we are going to use the API service and especially Google Maps API. The Google Maps API is an open source service which let us embed Google Maps in our own web pages. The API provides a number of utilities for manipulating maps and adding content to the map through a variety of services, allowing us to create robust maps applications on our website.
There is nobody in this world that hasn’t made these questions to himself: “Where can I found this place?” or “How can I get there?” Most modern cars are equipped with Global Positioning Systems (GPS) which help the driver to find addresses and get there quick and easy. Another useful function that most GPSs have is a preinstalled list of Points Of Interest (POI) separated into categories for many different countries. So the driver can find restaurants, museums, hotels, without the need of knowing the specific address, by just selecting the category and the name.
The main idea of this project is to create a web site using Google Maps in order to give the opportunity to the users to find Points Of Interest online, without the need of an expensive machine like the GPS. The users will be able to select a residence area in Athens and then a map of this area will be appeared with all the Points Of Interest marked.
As we mentioned in the previous section in order to make our web site to work we used the Google Maps API service. The Google Maps API is integrated with the Google AJAX (Asynchronous JavaScript and XML) API loader, which creates a common framework for loading and using multiple Google AJAX APIs (detailed information about AJAX, API, JavaScript and eXtensible Markup Language -XML- can be found in section 1.2).
The dissertation will be based on a website from where the user will be able to choose a residence area in Athens and then, a map of this area will be appeared with all the Points of Interest marked. These points will be placed according to their real position in earth. To do this, we will use their Longitude, Latitude values. A variety of information will be available for each point and also filters could be applied for specific points (i.e.: just museums). Finally an advanced goal will be the system to be able to print detailed directions for the user to go to the store from his house. The whole project will be based on a PHP web page, JavaScript and a Database.
In the beginning of the project we decided to build two different interfaces, one for internal communication (Business to Business – B2B) and another for external communication with the customers (Business to Customer – B2C), but during the analysis we found out that is better to have one interface with multiple users having different privileges. So there will be an administrator who will able to manage POIs (add/delete/modify) and registered users who will be able to see the POIs and propose new ones.
After the completion of the implementation we have now the ability to provide a final and revised list of project objectives.
In order to get the origins of the internet we have to make a journey back in time to 1957. At this period United States of America and USSR were planning to launch a small earth orbiting satellite. United States scientists focused on a sophisticated three stage rocket but in Russia they took a more direct approach by strapping four military rockets together so on 4 October 1957 the USSR launched Sputnik I. The reaction in the United States was immediate, so they created the Advanced Research Projects Agency (ARPA) within the Ministry of Defense. Its mission was to supply state of the art technology to US defense and to avoid being surprised again.
ARPA gathered a couple of hundred top scientists to focus on research for many different technological subjects. In 1962 ARPA opened a computer research program and appointed to its head an MIT scientist John Licklider. Licklider had just published his first memorandum on the “Galactic Network” concept, which was a futuristic vision where many computers would be networked together and would be accessed to everyone. In the same time within ARPA, Leonard Klienrock had many ideas about developing a network, where information could be sent between the computers into small packets of data.
The inadequacy of the telephone network for running programs and transferring data was revealed in 1965 when, in a part of an experiment, computers in Berkley and MIT were linked together over a low speed dial up telephone line and became the first Wide Area Network (WAN) ever created. After a lot of research between teams at MIT, the National Physics Laboratory (UK) and by RAND Corporation, the ARPANET network was created and the best ideas, from the research on wide area networks, were incorporated into ARPANET design which became the ancestor of today’s internet. By September 1971 ARPANET linked 23 host computers to each other (Figure 1.1).
Figure 1.1 – ARPANET in 1971
In 1974, ARPA scientists working with experts in Stanford developed a common language that would allow different networks to communicate with each other. This was known as a Transmission Control Protocol/Internet Protocol (TCP/IP). That was the main ‘key’ for the evolution of the internet. Many networks created and with the help of this protocol they were connected together, making reality the “Galactic Network” idea of John Licklider. By the end of 1980 more and more computers were connected together making a huge network using the TCP/IP protocol (Figure 1.2).
Figure 1.2 – ARPANET in 1980
On the other hand the World Wide Web (WWW), which is a network of web sites that can be searched and retrieved through HyperText Transfer Protocol (HTTP), was introduced in 1989 by Tim Berners-Lee and other scientists in CERN (Geneva) the European Centre for High Energy Physics. The main idea was to make the retrieval of research documentation easier .So they developed a browser/editor program and gave the name World Wide Web. Later on, an improved browser was developed which allowed the links to be hidden behind text using a Hypertext Markup Language (HTML).
With the invention of TCP/IP networking and the World Wide Web, the internet took the nowadays appearance. Of course, techniques and new protocols were developed; so many that we could base a whole dissertation on them.
Maps were invented to guide native and foreign people to a place. Human developed and updated all kind of maps and as the technology evolved these maps took their electronic form as almost everything in this world. On the other hand the use of satellites helped extremely in the geographical survey of the earth and as a result the invention of the GPS (Global Positioning System) was the beginning of a new era in the use of electronic maps. Using an “eye in the sky” people could now be able to know their precise position on the earth and use this information for several purposes. In the beginning GPS was used in airplanes and vessels providing information about their place, the elevation and their speed. The last few years the GPS was integrated in cars providing details about the road names and giving detailed directions to go from one place to another.
In order to determine a position on the earth, we separated the earth into horizontal and vertical lines (Figure 1.3) known as latitude (horizontal) and longitude (vertical).
Figure 1.3 – Separation of the earth using Latitude and Longitude coordinates.
Latitude is the angle at the centre of the coordinate system between any point on the earth's surface and the plane of the equator. The lines which join points of the same latitude are called parallels and they make concentric circles on the surface of the earth. Each pole is 90 degrees, the North Pole is 90º N and the South Pole is 90º S. The 0º parallel of latitude is called equator which imaginary divides the earth into the Northern and Southern hemispheres.
Longitude is the angle east or west, at the centre of the coordinate system, between any point on the earth's surface and the plane of an arbitrary north-south line between the two geographical poles. The lines which join points of the same longitude are called meridians. All meridians are halves of great circles and are not parallel. The line passing through the Royal Observatory, Greenwich (UK) is the international zero longitude reference line, the Prime Meridian. The antipodal (earth’s opposite surface) meridian of Greenwich is both 180º W and 180º E.
By combining these two angles every position on the earth can be specified. Also in order the coordinates to be more specific we divide degrees into minutes and seconds.
JavaScript is a scripting language which is most often used for client side web development. JavaScript was influenced by many programming languages but it was designed to have similar look with Java. It has first class functions which let the user to manipulate the HTML script. Those functions can be called from the HTML (for example when hitting a button or a link) and variables can be sent from HTML to JavaScript and reversed. Except from the web JavaScript is used in programs like Macromedia Director as the programming language.
XML stands for eXtensible Markup Language, it was classified as extensible language because it allows its users to create and define their own elements. Its main purpose is the sharing of structured data across different information systems and especially through the Internet. XML consists of tags, each one defining the elements that are going to be stored; every tag must have a start - <tag> - and an end - </tag> -.Although there are other markup languages, XML is recommended by the World Wide Web Consortium. Nowadays XML is used by many web applications and many people using it without knowing it, as it is working in the background (RSS Feeds). An example of the XML syntax can be found on Figure 1.4.
Figure 1.4 – XML structure example.
Google Maps features a map that can be navigated by dragging the mouse, or using the mouse wheel to zoom in or out to show detailed street information. Users may enter an address, intersection or general area to quickly find it on the map. Like many other map services, Google Maps allows for the creation of driving directions. It gives the user a step by step information of how to get to a place, the time needed and the distance between these places. Google Maps offers five viewing modes by default: Map (topographic and street map), Satellite (satellite and high-resolution aerial photographs), "Terrain" (geographic features in high relief with street overlay), Street View (Ground level 360 degree view of certain streets), and Traffic' (traffic maps).
As the Google Maps code is almost entirely JavaScript and XML, some end-users reverse-engineered the tool and produced appropriate scripts which allowed a user or website to introduce extended or customized features into the Google Maps interface. Using the map/satellite images hosted by Google, such tools can introduce custom location icons, location coordinates and metadata.
Google created the Google Maps API integrated with Google AJAX API loader to the opportunity to the developers to embed the maps into their websites and point their own places on them. It is a free service for home users, which currently does not contain ads, but Google states in their terms of use that they reserve the right to display ads in the future. By using the Google Maps API we can embed the full Google Maps on an external web site. First we need to get an API key which will be bound to the web site and directory that we used to acquire that key. Creating our own map interface involves adding the Google JavaScript code to our page, and then using JavaScript functions to add points and many other interactive things to the map.
AJAX (Asynchronous JavaScript and XML), is one of the many web development techniques for creating interactive web applications. The target is to make web pages feel more responsive by exchanging small packets of data with the server so that the entire web page does not have to be reloaded each time the user requests a change. This is intended to increase the web page's interactivity, speed, functionality, and usability. AJAX is asynchronous so any data requested from the server is loaded in the background without interfering with the display and the behavior of the user’s current web page. AJAX is using JavaScript in order to call the necessary functions and methods. The key technology that makes AJAX work is the XMLHttpRequest JavaScript object which is an API that can be used by JavaScript, and other web browser scripting languages to transfer XML and other text data to and from a web server using HTTP, by establishing an independent and asynchronous communication channel between a web page's Client-Side and Server-Side. A detailed diagram of how AJAX works can be found in Figure 1.5.
Figure 1.5 – AJAX Communication Diagram
If we examine the figure 1.5 we can see an AJAX Engine component. Actually this is not a standalone component being somewhere over the internet but we can describe it as a “loader” embedded in our web page which communicates continually with the web server. From now on we are going to refer to it as AJAX Engine.