Design, Programming, Music and Life

Saturday, September 29, 2012

Fun with code: GPS tracking on the cheap

I have set out to learn a bit more about the Google Maps API and how to easily impliment a custom map into Joomla. After looking around quite a bit, I was not able to find anything I could use. What the client wanted was a simple map view showing where his drivers were. The thing about this though, is that they did not want to spend too much $$ on new equipment or GPS fleet tracking software, and he only wanted something simple.

After hours and hours of research and testing, I have found what I think to be the easiest way to impliment multiple KML layers into a single map and I will share my findings with you all too ;) You will need a few things first though, so open up a new browser tab and go install Google Earth if you haven't already. Once you have that, we are ready to get started.


Start by opening up the Google Latitude page, and sign up for a new Google ID per vehicle, biker, etc you want to track, and in Latitude, go ahead and set up a location. Click Privacy Settings, and set that to Detect Your Location. Then tap on the gear in the upper right.
Once you click the gear, choose Advanced Settings. This will open a new screen showing widget embeding options. At the bottom of that page, you will see a Developer Informaion link, click it. and select the KML link.


Now we will go into Google Earth and add that link. Across the top, go to Add, and then Network Link.


Then fill out the info for your location and on the Refresh tab, you can set up your refresh options for the location. It should look something like the dialog here.

Next we want to open a normal Google Maps page, and we will set up our route here. Enter in all the stops on the route, and when done, click Get Directions.
Once finished there, scroll down to the bottom of that left hand colum, and select the Save to My Maps link. Once that opens up, make sure you click the KML link, and save it to your computer somewhere.






We will then open up Google Earth, and open the saved KML file. This will show up in your Map view after imported. Repeat the process how ever many times you need to for trackers and routes, then save the setup as a new KML file by right clicking on the main group, and selecting Save Place As. Then upload the KML file to your server.

Once you have the KML file saved on your server, you will have to create a page to load and show it. Many of the solutions I found online needed a PHP file and an HTML file to function, well I found an easier way for this with just a simple HTML file.

<!DOCTYPE html>
<html>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Maps Example for loading a single KML file, or multiple KML files. </title>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
initialize() ;
});
function initialize() {
  var myLatlng = new google.maps.LatLng(42.97112, -85.679208);
  var myOptions = { zoom: 14, center: myLatlng, mapTypeId: google.maps.MapTypeId.TERRAIN}
  var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  //Route1 Info
  var georssLayerR1 = new google.maps.KmlLayer('http://yourwebsite.com/maps/routes.kml', {preserveViewport: true});
  georssLayerR1.setMap(map);
}
</script>
<body>
  <div id="map_canvas" style="width:100%;height:500px"></div>
</body>
</html>

Once you have this set up, save the HTML file on your server, and you can load it in Joomla by making a simple Wrapper Widget, and setting the URL of the widget to be your saved HTML file.

That's about it for this lesson, if I missed anything, let me know ;)






Friday, September 28, 2012

How to avoid the iOS 6 update wiping all your contacts

I'm back again with another helpful hint for updating to iOS 6. In some cases, the iOS 6 update is erasing all the contacts off the iCloud account, and that is never a good thing to have happen, so I have a nice and simple solution for this just as a precaution.

The only thing you will need for this solution is a Gmail account. Once you have that set up, we will need to get out your iOS device and go to Settings>Mail, Contacts & Calendars> and Add New. Set it up as an Exchange account, and use m.google.com as the server. Make sure you also use your full gmail address as the login/account too. When it confirms connectivity, just select Contacts, and whatever else you dont have syncing already.

Next we want to give it time to sync all your contacts to Google's servers, after that, you will want to go to Settings>iCloud> and make sure it is turned on, everything is selected, and you have a recent backup. If you dont, do it now, and walk away for an hour.

Once done, you are all safe to Restore and Update your iOS Device. If something goes wrong with the update, and all your iCloud contacts are wiped, you have Google's exchange set up already syncing them anyway. (Personally, I turn off iCloud Contact Sync because it has a tendency to double my contacts randomly) Just make sure once the update is done, you select Restore from iCloud and you will be all set ;)


Friday, September 21, 2012

How to get Google Maps back on iOS 6 (sorta)

9:18 AM Posted by Unknown , , , , , , , No comments
Since iOS 6 has dropped, the main complaint I am seeing so far deals with the lack of Google Maps and the replacement with Apple's own brew of maps. But the accuracy and inclusion of metro areas has been a bit buggy in some areas, so I'm going to show you how to get a form of Google Maps back on the device.

This is a super simple and easy trick to get a shortcut to googles maps services onto your homescreen. Start off by opening Safari, and in the address bar, type "maps.google.com", Googles server will redirect you to their mobile maps, and then from there, all you have to do is tap the share icon, and then tap on "Add to Home Screen", (It might even prompt you if you're lucky). That's it! Now you can navigate all areas that Apple Maps won't let you.

Drop me a commen or share if this helped you out at all ;)

Wednesday, September 19, 2012

A basic iOS 6 heads up

12:04 PM Posted by Unknown , , , , , , , , , No comments

Today is the day, and as most of us Apple users get ready for the release of iOS 6, I thought I'd take the time to cover a few basics. 
  1. It will be available OTA. Over the years, those poor Apple Tech Support people have been sent out to the slaughter on days like today, all because the majority of iOS users all still use their computers to backup and restore, Hardly any of you still have iCloud set up for backing up your device. Please do yourself a favor before updating, Make sure you have iCloud set up and that you have a recent backup in the past couple days, if you don't... DO IT NOW!!!! Then save you and those Apple Technicians some time and headaches by going to Settings > General > Software Update > and check for your update there (WiFi Needed).
  2. If you don't have WiFi, you’ll need iTunes 10.7. Apple released the next version of iTunes a little bit ago, but if your computer is anything like my Families, the software update in iTunes did not work right. What you will likely need to do is go over to the iTunes download page and grab a fresh copy. http://www.apple.com/itunes/download and then install it on your computer. This will make sure your computer can read your iPhone after the update, and if you don't have WiFi, it will allow you to update the old fashion way. 
  3. Backup, Backup, BACKUP!! The worst thing you want to have happen is you go through with all this and you then found out you never backed up your device. I suggest using iCloud for backups, but if that is not an option for you, make sure you do a backup the old fashion way through iTunes. You can force this by right clicking on your devices name in the left hand side, and selecting Backup. 
  4. Delays are the name of the game when millions of people all try something at once. It's best to just be patient, and keep trying if the update fails. Try, try again until it finishes, but don't interrupt the process, this can cause damage to your device. Just ride it out, and if it gives an error, start over.
  5. You are going to want at least half power to start the process. A good rule of thumb is to charge your iOS device to at least 30% before starting an update. I say 50%, because you never know what can go wrong, and its a bad thing to loose power half way through an update. You might have to learn hot to enter DFU mode as a weekend project if that happens. 
  6. Some of your apps might have bugs after the update. Just exercise caution here, not all app developers have gotten their app caught up to iOS 6 compatibility, but they are likely to get there eventually. If you come across any of these apps, just try not to use them until you notice an update from the App Store for them. 
  7. Apple being vague? Never!! They just don't mention the release time. In the past couple years, Apple has released the update at 1:00 EST (10:00 PST) , so it's a good bet that it will happen today around this time. If you haven't received your update by this evening, it likely means you have a firewall issue, or you have a DNS issue. Good luck ;)
That's about it for the iOS 6 heads up, I hope this helps a couple of you out there. 

Monday, September 17, 2012

Wednesday, September 12, 2012

Animated Windows 8 RTM/PRO theme

3:27 PM Posted by Unknown , , , , , , , , , , , , , , No comments

So I upgraded to Windows 8 RTM today, and my first adventure on it was a simple theme. There is a nice feature to this theme though, it is animated, so the desktop background will change in hue slowly over time, allowing a smooth transition from blue to green, yellow, orange, etc. I did most of this work years ago, but adapted it for Windows 8 RTM and PRO.

You can find the theme over on Deviantart for now ;) http://electrikjesus.deviantart.com/art/ID-Animated-Win8-theme-326807125