Category: Recreational Coding

Jul 29 2009

My Location Information

For some reason there isn’t a reasonable URL shorteners specific to Google Maps, so I decided to write one up.  I thought of using bit.ly for shortening map URL’s, but I wanted a TinyURL domain that let users know they were going to get a map.  So I decided to register myloc.info and build a simple TinyURL map engine.

UberTwitter uses a very similar domain, myloc.me.  Their results send you to a Uber advertising page with a map in the middle.  Not very mobile friendly, but free is free I guess.  My version works great with the iPhone. It automatically pulls open the Map application. Normal browsers are redirected to Google Maps.

As an add on, I created a basic GET JSON API, so myself and others could easily incorporate this service into projects.

Jul 24 2009

Bele Chere Mobile

Last year I was generally lost in the crowd and didn’t have any good idea of what was going on at Bele Chere. On Wednesday of this week, I decided to write up a small mobile app for the Bele Chere festival. I wanted something basic to show my current location and the events going on around me.

What I came up with was belechere.mobi.  It’s basically a google map with all the Bele Chere events and points of interest plugged in.  I geared the app for the iPhone so I could use the built in GPS with Safari to center the map automatically.  Also, I incorporated Twitter results with the #belechere tag, that way I could easily see what people thought was intresting or a must see at the festival.  I also included list of music acts for Friday, Saturday and Sunday.  It’s only a three page app, but I am sure it will be useful compared to what I had last year.

BeleChere.Mobi

The app took me an evening and a morning to build, but I did have a legup with some Twitter feed code from my Twaper experiment.  After some field testing  yesterday downtown Asheville, I found that the GPS seems accurate to about 50 feet of your location and the point of interest icons are generally in the right spot.  Sometimes though, the app forgets you allowed for GPS services and a website refresh is needed to get it back.  There also seems to be a dead zone on College street between Lexington and Haywood.

Apr 22 2009

Twaper Twitter Widget

Our local paper made some national news by becoming the nations first Twaper. When the site MountainX was visited on April 1st, users were presented with a number of twitter feed modules. Some of those feed widgets were filterable by twitter #hashtags.

I decided to recreate the twitter widget here.

Live Demo

Twaper Feed Module

The twitter.aspx page pulls down a copy of the twitter search results in Atom format. A XSL stylesheet converts the results to a friendly HTML format, which are then ported to a div tag using JQuery.

Download

Feb 14 2009

Yard Sale Update

Today I posted a sturdy new version of the free yard sale software. I’ll be adding some live yard sales for this coming weekend so we’ll see what happens. As usual, I am testing the build on one of my own domains, so no clients were harmed in the process.

Some additions.
-Add up to 4 photos to a yard sale.
-Turn by Turn driving directions.
-Individual yard sale printer friendly pages.
-City Specific yard sale directory.

There is still the subscriber and email marketing section that isn’t reworked yet.  I am going to research that a bit more before moving forward on that piece.  After I’ve done some testing and finished coding, I’ll post a new build for download.

Oct 13 2008

DIV Tag based Google Maps for Wordpress

After researching a few implementations of Google Maps with Wordpress and not finding one that seemed to fit, I decided to roll my own solution. My basic idea was to keep everything tag based and as simple as possible. Ideally I should be able to place a DIV tag on a page, fill out some basic attributes and then let Javascript pick up the work from there. I was able to integrate a few features that many people may find useful with a tag based google map.

First is a basic map loaded based off an address, really pretty simple.


Above is the result from the code below.

<div class="googlemap gmsmall"
address="Patton Ave, Asheville, NC"></div>

Here is an enhanced version of the same map with some additional controls added based on some optional attributes. These settings control the map controls and manually sets the zoom level. Also, any HTML you put inside the DIV will be pushed to the popup bubble on the map.

Party inside the bubble.

BYOB! Party Gif

Above is the result from the code below.


<div class="googlemap gmmedium"
address="Patton Ave, Asheville, NC"
zoom="10"
pan="yes"
scale="yes"
type="yes">
<h3>Party inside the bubble.</h3>
<b>BYOB!</b>
<img src="http://www.ragingsmurf.com/(...)/party.gif"
alt="Party Gif"
title="party"
width="100"
class="alignnone size-medium wp-image-108" />
</div>

Also, I included a way to generate driving directions between to points. A couple thing to keep in mind, first you need to specify a directions attribute where turn by turn directions will be funnelled and this needs to be a DIV with the same name somewhere on the page. Also, the zoom doesn’t need to be specified since the google api takes care of that.

Driving Directions


Above is the result from the code below.

<div
class="googlemap gmlarge"
fromaddress="Asheville, NC"
toaddress="West Asheville, NC"
directions="route" pan="yes"></div>
<h3>Driving Directions</h3>
<div id="route"
class="googleroute"></div>

Implementing this on your Wordpress Blog.

1) Add the following styles to your Stylesheet (style.css) under Theme Editor.
.googlemap {
border: 1px solid black;
}
.googleroute {
border: 1px solid black;
width : 300px;
}
.gmsmall {
width: 200px;
min-height: 200px;
height: 200px;
}
.gmmedium {
width: 300px;
min-height: 300px;
height: 300px;
}
.gmlarge {
width: 400px;
min-height: 400px;
height: 400px; }

You can of course modify the above styles to accommodate your preferences and Wordpress theme.

2) Sign-up for a Google Map Key.

You can sign up for a free google map key, you then need to get access to the Header.php in your sites current theme folder.

3) Add Javascript References to the Header.php file
<script
src="http://maps.google.com/maps?
file=api&v=2&key=YOUR_MAP_KEY"
type="text/javascript"></script>

<script type="text/javascript"
src="<?php bloginfo('template_directory'); ?>
/scripts/maps.js"></script>
4) Finally, download the Maps.js

Save this file into your theme Scripts folder.

Known bugs.

  1. (10/13/2008) If two or more DIV tags contain the same exact addresses, only the first map will load. So if you have a need for two or more maps with the same address, adjust the address every so slightly. i.e. (Patton Ave, Asheville, NC) and (Patton Ave, Asheville NC)
  2. (10/13/2008) Wordpress hates recognizing HTML when there are carriage returns, so when you are creating your DIV tags make sure their all in one line.
Final thoughts

This is a very basic implementation of the Google Maps API, I can imagine there are a lot more features that can be added to this script while still keeping it’s implementation simple. If you have some feedback, please feel free to contact me or leave a comment.

WordPress Themes