Websites, Mashups and more

Thursday, February 09, 2006

Using Yahoo Maps

I started recently experimenting with Yahoo Maps. I was drawn to them for a number of reasons to mention a few: Their use of Macromedia Flash and ability to load markers without affecting performance.

Yahoo has two types of Maps. The AJAX version which is very close to the Google Maps one and the Flash version which has huge potential. One main distinctive feature that sets the Yahoo maps apart from Google is the ability to run the Maps locally on the computer. Google requires you to run the map from a website. The Yahoo AJAX Maps API is very similar to the Google Maps API. I am almost positive that they have decided to replicate everything that Google came up with including function names for the API. As far as performance, I noticed that the Yahoo AJAX maps load fast and has the ability to handle markers better than Google. I still need to run more tests to compare other features. Yahoo AJAX Maps however have a very lame Bubble window. The Google Bubble window on the other hand is more complex and has a better interface.

The Yahoo Flash Maps is a different beast. The API calls are very different than the AJAX version. I will give this map more testing. The Flash Maps has a nicer layout than Google and Yahoo AJAX maps. However, the map performance when it comes to dragging and refreshing images is not as good.

In the next few days I will run a head to head comparison between the AJAX and Flash versions of the Yahoo Maps. And a comparison between the Google and Yahoo Maps features

Categories: Dynamic Maps_

Monday, February 06, 2006

Blogger Categories in 5 minutes (A different approach)

After I got feedback from users I have made an update at the end of this posting.

This is an update to my previous posting on categorizing blogger entries. As I mentioned in my previous postings, has no categories. There are a number of ways to bypass this problem such as using delicious or using the blogger search. I use the Blogger Search Engine to categorize my postings by inserting the name of the category in the posting's title and using the blogger search to find entries for a category. For more details read my previous posting.

After using my method for a couple of weeks I realized that it has some problems.

  1. By inserting the name of the category in the title, the title became too long and overcrowded.
  2. The postings title is also used to create the URL for the posting. As a result, if you want to add your posting to a new category the URL will change. This will cause problems if people already made links to your posting

For these reasons I have made a number of changes to my method. The category's name will no longer by placed in the title but rather in the posting's body. I have also decided to use CSS to either hide the category name or give it a special look. The following is the set of steps you need to take. It will take you five minutes at most:

1) When you login to your blogger account go the "Template" tab. Insert the following javascript code right before the body tag (<body>)

<script language="javascript">
var blogUrl = "BLOG_URL_HERE";
function showCategory(category){
category = "\""+category+"_\"";
var url = "" +
escape(category) + "&bl_url=" + blogUrl;
window.location.href = url;

replace URL_BLOG_HERE with your blog's url. For example, the url to my blog is so the line should look like

var blogUrl = "";

make sure not to include http:// or the www

2) Now we will create the categories section (or menus). In your blog template go the section that start with following text

<!-- Begin #sidebar -->
<div id="sidebar">

Insert the following text:

<h2 class="sidebar-title">Categories</h2>
<li><a href="javascript:showCategory('Category 1');">Category 1</a></li>
<li><a href="javascript:showCategory('Category 2');">Category 2</a></li>

Make sure to replace Category 1 and Category 2 with the real names of the categories

3) (This Step is Optional) In your blogger template insert the following piece of code in the CSS area
(The area starts right after the following line <style type="text/css">)

.category { font-style:italic;}

If you want your categories to be hidden then insert the following instead

.category { display:none;}

4) Finally, when you create a new posting for your blog insert the categories text at the end

Category 1_, Category 2_, Category 3_,...

If you are using CSS from step 3 above then insert you categories in the following format

<span class="category">Category 1_, Category 2_, Category 3_, ...</span>

Make sure to append your category names with the "_" character. You can separate cateogry names using commas (like the examples above), spaces, semi colons, etc...

Keep in mind that when you create a new posting the blogger search takes at least 10 minutes to index your posting and insert it into its records. This means that your posting will not show up directly under that category. Some people might complain about this. Personally, I think this is not a big issue because eventually the posting will get indexed. So far, the average time it takes to index the posting is 10 minutes. The most that I have experienced so far is half an hour.

Categories: Code Snippets_ , Blogger Categories_