Google maps – highlight sidebar text on marker mouseover

Sometimes when integrating a Google map on a site it is useful to give feedback to the user when hovering the mouse over a map marker. While not very difficult to achieve, it may not be completely straight forward to beginners, so I just wanted to post my solution here.

The trick is to add a listener when creating the markers, and then use getElementID to select the corresponding item in the document, identified by a uniqe ID.

(Java script)
var marker = new GMarker(point, customIcons[\"standard\"]);
GEvent.addListener(marker, \"mouseover\", function() {
marker.setImage(\"../images/marker_h.png\");
var listItem = document.getElementById(\"item-\" + j);
listItem.style.backgroundColor = \"#FFFA5E\";
});
GEvent.addListener(marker, \"mouseout\", function() {
marker.setImage(\"../images/marker.png\");
var listItem = document.getElementById(\"item-\" + j);
listItem.style.backgroundColor = \"#FFFFFF\";
});

Continue Reading »

Popularity: 7% [?]

No Comments Posted in web development
Smart CSS trick to add icon to all outgoing links

Use this piece of CSS to add an icon to all links that is not to mydomain

a:not([href*="mydomain"]) {

 padding-right: 10px;

 background: transparent url("images/aoutside.gif") center right no-repeat;

 Continue Reading »

Popularity: 6% [?]

No Comments Posted in CSS
Component could not be upgraded – error with Media Player 11 and Vista

When trying to view some digital rights managed content I was instructed to upgrade Media Player, but the upgrade halted and I got the “Component could not be upgraded” message. No matter what I tried I could not get around this.

After some hours of searching on Google however, I came across this solution.

1. Click the Start button in the lower left corner.

Continue Reading »

Popularity: 6% [?]

1 Comment Posted in Misc
Simple Google Maps plugin for wordpress

What is it?
This is a demo post for a little plugin I wrote that uses custom fields in Wordpress together with Google’s HTTP geo coding API and Google Maps to produce a map with a marker in the post. The current version (0.5) of the plugin takes the following custom keys and use them to geocode the location (Zip, City, Address, Country) and also display them in the info window popup in the map. Keys marked with a * are required for the plugin to output the map.

  • Zip
  • City*
  • Address
  • Country*
  • Phone
  • Misc

Installation and useage
Continue Reading »

Popularity: 11% [?]

7 Comments Posted in PHP, Wordpress
MySQL fulltext searches

MySQL have a very nifty search function built in, which in many ways are more sophisticated than the WHERE LIKE (’%'). Using full text search with MATCH (…) AGAINST (…) AS relevancy it is also possible to get results ranked by relevancy. Here’s the quick, dirty way to do it:

1.  First we need to create a full text index for the fields we want to search (note that fields have to be of TEXT or VARCHAR type). This is done by

ALTER table1 ADD FULLTEXT (’column1′,’column2′,’…’)

Continue Reading »

Popularity: 8% [?]

No Comments Posted in MySQL