Category Archives: Cool Stuff

MTYahooMaps Status

Ok, I got MTYahooMaps plugin to work for Individual Entries and Category pages, but the Daily, Weekly and Monthly archives get all screwed up. I’ve tracked down the problem to the fact that when a Plugin gets called an Archive Context, there is no Entry to reference.

That is, when pulling an Entry from the context stash, No entry is returned, but you can get the Entries (multiple) out of the context stash. By going thru each Entry Text, I can determine which Entries being need MTYahooMap written for them but not Which one is currently being called.

To make things even more entertaining, I don’t want to assume that the page will be written with the Latest Entry at the Top, oldest at the Bottom.

Once I have an Array of Entries, I need to order the array by Creation Date. The question then is: Ascending or Descending? This is done via the Blog "sort_order_posts" setting which is accesable via the PERL API.

MTYahooMaps Test 2 – Multiple Maps

This should be two Yahoo Maps, The Top is of 11 Madison Avenue The Bottom is of 499 Park Avenue.

Update: Well, it works Only on the Individual Archive page. For Now, No Multiple Maps on One Post. So, I pulled the 499 park Avenue Map.

Update: Seems I got it. The Above Maps show up in all Archive types properly.

Finally Got Both of them Working…

Ok, I got Both MTGoogleMaps and my New Plugin MTYahooMaps Working in both I.E. and Firefox. Can They work in the Same Post? On the Left will Hopefully be a Google Map of 11 Madison Avenue, on the Right, A Yahoo Ajax Map of 11 Madison Avenue…

Update: In Internet Explorer ONLY, Some of the Post shows up Between the Images. It’s a DIV problem solved by a clear:both. To make sure Everyone can see the two Maps, I put it at the Bottom.

Last Update: It works perfectly. I’ve added Latitude and Longitude Parameters since I was a little unhappy where the Geocoder put 11 Madison Avenue. This comming week, I’ll write the documentation for it.

These two maps were made with this Code Strung together:
<MTGoogleMaps address=”11 Madison avenue,NY, NY, 10010″
info=”A Nice Place”
width=”273″ height=”300″ zoom=”2″
zoomcontrol=”large”
maptype=”map” align=”left”
lat=”40.741453227756246″ log=”-73.98656845092773″>
</MTGoogleMaps>

<MTYahooMaps address=”11 Madison avenue,NY, NY, 10010″
info=”A Nice Place”
width=”273″ height=”300″ zoom=”3″
maptype=”ajax” align=”right”
lat=”40.741453227756246″ log=”-73.98656845092773″>
</MTYahooMaps>

MTYahooMaps Test

With a Little luck, this will be a Flash Based Yahoo Map in an Iframe. It will have a Marker for 11 Madison Avenue and a Closed Nav widget… BooYah!

Maps in Movable Type as a Plugin – Different Approach

Ok, a lot of issues came up when using Google Maps or Yahoo Maps inside a DIV Boundary:

  • Google Maps and Internet Explorer blows up Every single time it’s inside DIV Boundaries.
  • Yahoo Maps Beta gets inconsistent results when it shares the same page with Multiple Yahoo Maps and with I.E.
  • Yahoo Maps and Google Maps will NOT coexist on the same HTML file.

Solution: Write the Map HTML to it’s own HTML File and include it on the page via a IFRAME.

Sounds simple but it’s a little tricky. MT loads the plugins with mt.cgi in the same memory space and invokes the same plugin for different context. That is, the same plugin with the same Values Multiple times for everywhere it is needed. This means that unless you are careful, you’ll write out the same Map HTML file multiple times.

 
With a little careful PERL coding, we avoid that and write out the file alongside the Individual Archive File in the same Directory. This has a bonus for me: This was very educational and I’ve gained a good understanding of how MT Plugins work and how to code for them in PERL.

Next up:

  1. Add loging via the MT::Log Module. There really should be a log entry telling the Admin what new files have been created. Operationaly, it’s a good idea.
  2. Add error catching if the Geocoder can’t resolve an address. Let’s the User know that it won’t work and a Map will not be produced. Also Add Error Catching to qualify the parameters passed to the plugin.
  3. Add Longitude and Latitude parameters in case the user does not have an address but used the many Geocoders on the Internet to get one.
  4. Add Multiple Markers on the Map.
  5. PolyLine area support.

When I’m sure the Bugs are all gone, I’ll send Nick Punter both the MTGoogleMap verison and the MTYahooMap version.

Image cut and pasted from Google Maps.

Oddly, it has "Imagery ©2005 State of New Jersey" Even though that is 499 Park Avenue in Manhattan. Is NJ Spying on us??

YahooMaps Beta Test 1

If this works, I’ll get a Map of 11 Madison Avenue…

Likely it blows up on the first try…

Update 1: Yep, It blew up. Left some important Template variables out of the PERL portion.
Update 2: Added a Flash Template that **STILL** doesn’t work to well in I.E.
Update 3: Will add Browser detection. If it finds a I.E. Browser, It will use Yahoo Maps AJAX version.

Off for Thanksgiving Dinner!

Happy Thanksgiving to All!

MTGoogleYahooMaps or Just MTWebMaps – Test 2

Hopefully, This will be a Map of 499 Park Avenue in both Firefox and Internet Explorer…

Update: Need to fix a “feature”. If you have two MAPS on a page they get the same DIV id. Might use Perl time() function to generate unique ID’s for the Map and Marker ID’s. Ugly, but it would work.

MTGoogleMaps

I’m Playing around with a new plugin called MTGoogleMaps By Nick Punter. It’s a cool idea and should be fun to implement. Also, the PERL code is a nice and neat piece of programing.

Update: It would have helped if I had the HTML::Template and LWP::Simple perl Modules installed. Fixed via ´perl -MCPAN -e shell´ and just installing them.

Another Update: Get the Process Tags plugin. With my installation of MT, Embedded Tags in the Entry won’t work without it. After installing it I changed my Templates from ´<$MTEntryBody$>´ to ´<$MTEntryBody process_tags="1" $>´ which seemed to do the trick nicely.

Yet Another Update: Don’t use the Ajaxify WYSIWYG Plugin with this as Ajaxify striped out all sorts of things!

Last Update: In GoogleMap.pl, sub jstemplate, fixed a slight and subtle bug:
Changed:
$loglat .= "$1, $2"; to
$loglat = "$1, $2";

Also added zoomcontrol and Maptype as parameters.

The Map was created with:
<MTGoogleMaps address="11 Madison avenue,NY, NY, 10010"
info="11 Madison Avenue Nice Place"
width="540px"
height="300px"
zoom="2"
zoomcontrol="large"
maptype="map">
</MTGoogleMaps>

zoomcontrol can be “large” or “small”
maptype can be "map", "hybrid", or "satellite"
Both zoomcontrol and maptype are optional.

My Modifications are trivial, Nick Punter did the hard work by researching the hows and why to apply this to Movable Type.

Note:It breaks with Internet Explorer. Bizarre! It works fine in Firefox & Opera!!! The authors Web page blows up too.

Anyone use Safari on a Mac? Let me know the result at sd_042 ât yahoo.com

I’m betting that the HTML that gets generated is not quite agreeable to Internet Explorer so I’ve modified the generated javascript code to detect the browser. I’ve isolated it to the script block, but can’t quite figure out what it is exactly. I’ll put it on my List of things to do…

The Stormtrooper Chronicles

StormtrooperOne of the web sites I like to go to is Danny Choo‘s.  To put it mildly, he’s someone who really likes to enjoy life. He currently lives in Tokyo and he has a really interesting blog that I regularly visit. His site has posts about Anime, Modeling, Ipods , etc.

In July of 2005, he purchased a set of Star Wars Stormtrooper Armor. Yep, you read that right! He’s been kind enough to document his trials and travails. 

I Highly recomend reading about it, His journey is very funny and he’s taken lots of photographs and some Video. The most recent Entry "Stormtrooper haircut" made me laugh out loud.

His "Stormtrooper in Tokyo – Episode 2 : Akihabara" posting is great too. 

For a complete Stormtrooper Summary on Danny Choo’s site See here.

He’s also got excelent tips for people switching from Windows to a Mac.

 

Building a PG Mk II

PG-MK-II-AEUG-box.jpg

I’ve started building a Perfect Grade RX-178 Gundam Mk- A.E.U.G.

Building these is a hobby I’ve been doing for a few years. It keeps me out of trouble and is, frankly, fun.

As for the model I think the proportion is off, but like almost all of Bandai’s Perfect Grade models it has a Nice level of detail.

Box photo from Hobbysearch

Continue reading