My first Gae website (MAP + album)

Source: Internet
Author: User

Give me the Link first: http://photo.sharesh.cn (my second-level domain name) or http://shareshcn.appspot.com (second-level domain name provided by Google), a total of three pages, the home page is a map, then there is a photo album page, then there is the photo list page. I have been using micolog to build a Gae website, but it is not actually a website, it is just a blog, and there is no actual writeCodeSo it cannot be my GaeProgramThe Gae website was finally completed today, although it may have only written dozens of lines of code and three static pages, but this is indeed the result of my experience for more than three weeks. from ignorance to data query, I started to try the code to complete such a website. I only know it.

I have been dissatisfied with the speed of domestic hosts for a long time. In addition, to make it easier to share photos and maps in the future, I decided to move all my website revisions to the Google App Engine. But my situation may be a little special: 1. I have 6000 photos, so there are about 12000 files (as many thumbnails as photos), and the files are about MB, if you put all the files in Gae, it is unlikely that there is a limit on the number and size of the files. 2. Use a new fixed link for some links, and the old URL can be switched to the new URL. 3. The original map content is retained and must be identified on the map for 46 locations (for the original webmap using mapbar JS, see sharesh.cn/default.htm ). How can we solve the above three problems?

First of all, due to the slow speed of hosts in China, it is impossible for me to reach out to images of hosts in China, and the speed of hosts outside China is not good, at least the access speed, but it is better than that of hosts in China, in this case, all hosts in China and abroad will be abandoned. At most, it can be regarded as an image. But I think of PWA, which is useful in the past. JS is an HTML + JS album. It uses Picasa Web Albums data API. You can implement the album with two files. Unfortunately, the URL is not very good and does not meet my SEO requirements. In this case, put two static files to Gae, that's too easy to use. (although I recently applied for Microsoft Azure to prepare an image for the purpose, no matter whether it is too small or not ). However, I have decided to put photos on Google picasaweb. I don't need to use 1 GB of free space. In addition, with such a good API, images can be made accessible, and the speed is very fast. So I reorganized the photos and uploaded all the more than 6000 photos. The results were half used. Thanks so much to Google, I finally saved all my static images. The final photo is a secondary development using Picasa Web Albums data API.

Then, we need to consider the link issue. At first we only considered the 2000 photos in Shanghai, so we directly followed the domain name with album, and shared it again when we arrived in Beijing, then we made it into the form of adding the domain name to Beijing and adding album, because I don't want to get messy under the root directory of the website FTP, and Shanghai is ready to add the domain name to Shanghai and album. If it is a PHP host, it may be possible to use the 301 redirection of. htaccess to achieve the goal, but how to deal with it on Gae? This is indeed a problem to be solved, but Gae seems to be pretty good. The shift should be much more powerful than. htaccess, as I mentioned in the technical summary.

The last step is the map. It was developed with mapbar in the early days and can be implemented in the form of reading XML with ASP, But Gae does not support ASP, so this path will definitely die. But I later made a webmap page for my friend (see the Tutorial: the architecture and technical implementation of a small webmap Project (gmapapi + jquery + XML), which is actually a static page, I only used jquery to read XML files and developed it using Google Maps APIs. In general, GMAP API is very simple and convenient to implement map effects, in addition, mapbar JS always finds efficiency or other problems, so it is not ready to be used again. I designed the entire Gae website in the first week and was also prepared to use jquery + XML for implementation. Later I made it very simple. I changed the GPX file to XML and then read it to jquery. But in the end, I gave up this method. Although Gae does fully support static files, it is not convenient to operate static files. Finally, we decided to use the Gae datastore. At least this datastore can be managed by logging on to the background and added, deleted, and updated. If static files are uploaded to Gae, therefore, only the covered parts cannot be deleted. Taking into account the ultimate convenience, the map will prepare the gmap api + datastore method.

I basically understand my ideas here. Basically, I used Python + datastore + Google Maps API + Picasa Web album data API for development, and finally stored it on Google App Engine. Since there are only three interfaces, so cut the three figures to see it, the specific can be accessed through my address: http://photo.sharesh.cn or http://shareshcn.appspot.com. The next article summarizes the technical points of the messy appengine/picasaweb API/gmap api and provides some technical points. If you have time to improve it, prepare an open-source program based on gae, which is in the form of MAP + album, but the overall thinking has not been taken into consideration yet.

Map of the home page (originally two markers, but when they are saved as PNG using theworld, they become two Black Blocks ):

Album list page:

Photo list page:

Finally, let's talk about gFW. As early as March 4, we went crazy about the last IP address of ghs.google.com, and then restored an IP address on the 9th, however, on the afternoon of the 14 th yesterday, all appspot.com could not be accessed. At least I could not log on in the afternoon, but through the proxy, so long ago I was unfortunately told by step 1, however, the domain name recorded by a yesterday can be accessed. GFW is really difficult to accept. It is really crazy to get rid of people. In addition, today appspot.com can be accessed again, which is crazy.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.