tag:blogger.com,1999:blog-80282475056422013892024-03-13T17:49:59.619-04:00Mike Gleason jr's BlogAnything Related to Web Sites: Technologies, Social Web, Programming, etc. I'm Doing Mostly .NET MVC in C#, JavaScript (jQuery), Google Maps API, MS SQL Server 2005 & 2008 and so Much More.Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.comBlogger48125tag:blogger.com,1999:blog-8028247505642201389.post-39351599574401110832015-02-03T07:27:00.000-05:002015-02-03T07:27:09.646-05:00Keep your GPS on check with GPS Ready<div dir="ltr" style="text-align: left;" trbidi="on">
<img border="0" height="320" src="https://4.bp.blogspot.com/-fwqP_Wio06A/VNC1lNf_lFI/AAAAAAAAFyo/1TT0-AlPgA8/s1600/device-art-01.png" style="float: right;" width="191">
Hello all,<br>
<br>
This has been a very very long time since my last article but I want to share something today with you.<br>
<br>
As few of you know, I am currently travelling around the world. I am constantly relying on my GPS to find my location, get driving directions, pin my hostels and places of interests, etc. Unfortunately, sometimes my GPS takes a long time to acquire a precise location.<br>
<br>
So I made an <a href="https://play.google.com/store/apps/details?id=com.mikecouturier.gpsready" target="_blank">android app</a> to help my phone find my GPS location faster. It is installed on my phone for a while now and it works perfectly! Today I want to share with you what was causing my problems and how I resolved them.<br>
</div><a href="http://blog.mikecouturier.com/2015/02/keep-your-gps-on-check-with-gps-ready.html#more">Read more »</a>Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com0tag:blogger.com,1999:blog-8028247505642201389.post-79851933876552036232012-12-05T20:53:00.000-05:002012-12-05T22:23:48.214-05:00Nexus 4 LTE with Fido (Canada)<p>I'm one of the few fortunate to have its hands on a Nexus 4 in Canada. I was with Vidéotron and the phone was working fine. But I wanted to try LTE and I got it quickly with Fido!</p>
<a href="http://blog.mikecouturier.com/2012/12/nexus-4-lte-with-fido-canada.html#more">Read more »</a>Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com22Montreal, QC, Canada45.5086699 -73.553992545.3306269 -73.8698495 45.6867129 -73.238135500000013tag:blogger.com,1999:blog-8028247505642201389.post-21391186010734827412012-06-25T10:25:00.000-04:002012-06-25T10:25:55.495-04:00Velocity 2012, iWeb is there!It's been a while since my last blog post but I'm happy today to take back the keyboard and announce you that I'll be today at the <a href="http://velocityconf.com/velocity2012">Velocity Conference 2012</a> in Santa Clara, California.
<a href="http://blog.mikecouturier.com/2012/06/velocity-2012-iweb-is-there.html#more">Read more »</a>Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com1tag:blogger.com,1999:blog-8028247505642201389.post-58468458271245844742012-05-02T14:05:00.000-04:002012-05-03T09:04:38.347-04:00Javascript Woes - NaNJust think about this:
<pre class="prettyPrint">
isNaN('');
// false
parseInt('');
// NaN
parseInt(+'');
// 0
</pre>
I found <a href="https://github.com/SteveSanderson/knockout/issues/461" target="_blank">a bug in knockout's documentation</a> and after reviewing the code, I found that this was the root of the confusion.
I'm happy to leave you confused as well :)Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com0tag:blogger.com,1999:blog-8028247505642201389.post-28797027359350279122011-10-08T12:30:00.002-04:002011-10-08T13:14:05.945-04:00Localized Ads Service Launched in Preview!Fellow bloggers and site owners,<br>
<br>
If you are using Amazon Associates, eBay Partner Network or any other affiliate program to monetize you blog/site, I've just launched a free service to help us make more money.<br>
<br>
The service lets you display different ads according to the country of origin of your visitors. It is self hosted and it is as simple to use as Google Analytics. There is only a JavaScript snippet to include in your pages!<a href="http://blog.mikecouturier.com/2011/10/localized-ads-service-launched-in.html#more">Read more »</a>Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com18tag:blogger.com,1999:blog-8028247505642201389.post-84409732138579271012011-07-18T21:04:00.009-04:002014-10-29T22:04:32.958-04:00Your Own Google Earth Web Page Screensaver in C#<div id="earth" style="clear:left; width:534px; height:350px; padding:2px; border:1px solid #CCC;"></div><div style="margin-top:5px;text-align:center;"><div class="las-ad" data-id="amazon-books-468x60"></div></div><script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAzAkrOIsv60fbtV-5UlnnJxRUrcFJRfPs1DYZSl5DdA7w5qtvARRv6HblVCIt_AgTSnG3PdPypHTBEQ"></script><script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script><script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script><script type="text/javascript">
// <![CDATA[
google.load('earth', '1');
// Some Variables
var geocoder = new google.maps.Geocoder();
var blogCopyImage = 'https://lh4.googleusercontent.com/-jZeNZUX1Ddo/ThzpTX7qgSI/AAAAAAAABXo/hy1634_XV-M/s800/blog-mikecouturier-com.png';
var twitterRequest = 'http://search.twitter.com/search.json?q=%23google&result_type=recent&geocode=39.3647281,-99.84206489999997,1525mi';
// On Document Ready, Initialize the Earth Plugin
$(document).ready(function() {
google.earth.createInstance("earth", initialize, function() { });
});
// Initializing Funciton
function initialize(ge) {
ge.getWindow().setVisibility(true);
ge.getLayerRoot().enableLayerById(ge.LAYER_BUILDINGS, true);
ge.getNavigationControl().setVisibility(ge.VISIBILITY_HIDE);
// Create the "blog.mikecouturier.com" ScreenOverlay
var screenOverlay = ge.createScreenOverlay('');
// Specify a path to the image and set as the icon
var icon = ge.createIcon('');
icon.setHref(blogCopyImage);
screenOverlay.setIcon(icon);
// Set the ScreenOverlay's position in the window
screenOverlay.getOverlayXY().setXUnits(ge.UNITS_PIXELS);
screenOverlay.getOverlayXY().setYUnits(ge.UNITS_PIXELS);
screenOverlay.getOverlayXY().setX(70);
screenOverlay.getOverlayXY().setY(20);
// Set the overlay's size in pixels
screenOverlay.getSize().setXUnits(ge.UNITS_PIXELS);
screenOverlay.getSize().setYUnits(ge.UNITS_PIXELS);
screenOverlay.getSize().setX(129);
screenOverlay.getSize().setY(21);
// Add the ScreenOverlay to Earth
ge.getFeatures().appendChild(screenOverlay);
// Starting View
var cam = ge.getView().copyAsCamera(ge.ALTITUDE_ABSOLUTE);
cam.setAltitude(12000000);
ge.getView().setAbstractView(cam);
// Some Other Options
ge.getOptions().setFlyToSpeed(0.3);
// Run!
setTimeout(function() { run(ge); }, 1000);
}
function getCoordinates(address, callback) {
geocoder.geocode({ 'address': address }, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var latlng = results[0].geometry.location;
callback(latlng.lng(), latlng.lat(), true);
} else {
callback(undefined, undefined, false);
}
});
}
function run(ge) {
var i = 0;
var tweets = [];
var lastTweetId = undefined;
(function timer() {
// Fetch Tweets If No Tweets To Display
if (tweets.length == 0) {
tweets =
[{
"coordinates": null,
"favorited": false,
"truncated": false,
"created_at": "Mon Sep 24 03:35:21 +0000 2012",
"id_str": "250075927172759552",
"entities": {
"urls": [
],
"hashtags": [{
"text": "freebandnames",
"indices": [
20,
34
]
}],
"user_mentions": [
]
},
"in_reply_to_user_id_str": null,
"contributors": null,
"text": "Aggressive Ponytail #freebandnames",
"metadata": {
"iso_language_code": "en",
"result_type": "recent"
},
"retweet_count": 0,
"in_reply_to_status_id_str": null,
"id": 250075927172759552,
"geo": null,
"retweeted": false,
"in_reply_to_user_id": null,
"place": null,
"user": {
"profile_sidebar_fill_color": "DDEEF6",
"profile_sidebar_border_color": "C0DEED",
"profile_background_tile": false,
"name": "Sean Cummings",
"profile_image_url": "<a href=http://a0.twimg.com/profile_images/2359746665/1v6zfgqo8g0d3mk7ii5s_normal.jpeg target=_blank rel=nofollow>http://a0.twimg.com/profile_images/2359746665/1v6zfgqo8g0d3mk7ii5s_normal.jpeg",
"created_at": "Mon Apr 26 06:01:55 +0000 2010",
"location": "LA, CA",
"follow_request_sent": null,
"profile_link_color": "0084B4",
"is_translator": false,
"id_str": "137238150",
"entities": {
"url": {
"urls": [{
"expanded_url": null,
"url": "",
"indices": [
0,
0
]
}]
},
"description": {
"urls": [
]
}
},
"default_profile": true,
"contributors_enabled": false,
"favourites_count": 0,
"url": null,
"profile_image_url_https": "<a href=https://si0.twimg.com/profile_images/2359746665/1v6zfgqo8g0d3mk7ii5s_normal.jpeg target=_blank rel=nofollow>https://si0.twimg.com/profile_images/2359746665/1v6zfgqo8g0d3mk7ii5s_normal.jpeg</a>",
"utc_offset": -28800,
"id": 137238150,
"profile_use_background_image": true,
"listed_count": 2,
"profile_text_color": "333333",
"lang": "en",
"followers_count": 70,
"protected": false,
"notifications": null,
"profile_background_image_url_https": "<a href=https://si0.twimg.com/images/themes/theme1/bg.png target=_blank rel=nofollow>https://si0.twimg.com/images/themes/theme1/bg.png</a>",
"profile_background_color": "C0DEED",
"verified": false,
"geo_enabled": true,
"time_zone": "Pacific Time (US & Canada)",
"description": "Born 330 Live 310",
"default_profile_image": false,
"profile_background_image_url": "<a href=http://a0.twimg.com/images/themes/theme1/bg.png target=_blank rel=nofollow>http://a0.twimg.com/images/themes/theme1/bg.png</a>",
"statuses_count": 579,
"friends_count": 110,
"following": null,
"show_all_inline_media": false,
"screen_name": "sean_cummings"
},
"in_reply_to_screen_name": null,
"source": "<a>Twitter for Mac</a>",
"in_reply_to_status_id": null
}, {
"coordinates": null,
"favorited": false,
"truncated": false,
"created_at": "Fri Sep 21 23:40:54 +0000 2012",
"id_str": "249292149810667520",
"entities": {
"urls": [
],
"hashtags": [{
"text": "FreeBandNames",
"indices": [
20,
34
]
}],
"user_mentions": [
]
},
"in_reply_to_user_id_str": null,
"contributors": null,
"text": "Thee Namaste Nerdz. #FreeBandNames",
"metadata": {
"iso_language_code": "pl",
"result_type": "recent"
},
"retweet_count": 0,
"in_reply_to_status_id_str": null,
"id": 249292149810667520,
"geo": null,
"retweeted": false,
"in_reply_to_user_id": null,
"place": null,
"user": {
"profile_sidebar_fill_color": "DDFFCC",
"profile_sidebar_border_color": "BDDCAD",
"profile_background_tile": true,
"name": "Chaz Martenstein",
"profile_image_url": "<a href=http://a0.twimg.com/profile_images/447958234/Lichtenstein_normal.jpg target=_blank rel=nofollow>http://a0.twimg.com/profile_images/447958234/Lichtenstein_normal.jpg</a>",
"created_at": "Tue Apr 07 19:05:07 +0000 2009",
"location": "Durham, NC",
"follow_request_sent": null,
"profile_link_color": "0084B4",
"is_translator": false,
"id_str": "29516238",
"entities": {
"url": {
"urls": [{
"expanded_url": null,
"url": "<a href=http://bullcityrecords.com/wnng/ target=_blank rel=nofollow>http://bullcityrecords.com/wnng/</a>",
"indices": [
0,
32
]
}]
},
"description": {
"urls": [
]
}
},
"default_profile": false,
"contributors_enabled": false,
"favourites_count": 8,
"url": "<a href=http://bullcityrecords.com/wnng/ target=_blank rel=nofollow>http://bullcityrecords.com/wnng/</a>",
"profile_image_url_https": "<a href=https://si0.twimg.com/profile_images/447958234/Lichtenstein_normal.jpg target=_blank rel=nofollow>https://si0.twimg.com/profile_images/447958234/Lichtenstein_normal.jpg</a>",
"utc_offset": -18000,
"id": 29516238,
"profile_use_background_image": true,
"listed_count": 118,
"profile_text_color": "333333",
"lang": "en",
"followers_count": 2052,
"protected": false,
"notifications": null,
"profile_background_image_url_https": "<a href=https://si0.twimg.com/profile_background_images/9423277/background_tile.bmp target=_blank rel=nofollow>https://si0.twimg.com/profile_background_images/9423277/background_tile.bmp</a>",
"profile_background_color": "9AE4E8",
"verified": false,
"geo_enabled": false,
"time_zone": "Eastern Time (US & Canada)",
"description": "You will come to Durham, North Carolina. I will sell you some records then, here in Durham, North Carolina. Fun will happen.",
"default_profile_image": false,
"profile_background_image_url": "<a href=http://a0.twimg.com/profile_background_images/9423277/background_tile.bmp target=_blank rel=nofollow>http://a0.twimg.com/profile_background_images/9423277/background_tile.bmp</a>",
"statuses_count": 7579,
"friends_count": 348,
"following": null,
"show_all_inline_media": true,
"screen_name": "bullcityrecords"
},
"in_reply_to_screen_name": null,
"source": "web",
"in_reply_to_status_id": null
}, {
"coordinates": null,
"favorited": false,
"truncated": false,
"created_at": "Fri Sep 21 23:30:20 +0000 2012",
"id_str": "249289491129438208",
"entities": {
"urls": [
],
"hashtags": [{
"text": "freebandnames",
"indices": [
29,
43
]
}],
"user_mentions": [
]
},
"in_reply_to_user_id_str": null,
"contributors": null,
"text": "Mexican Heaven, Mexican Hell #freebandnames",
"metadata": {
"iso_language_code": "en",
"result_type": "recent"
},
"retweet_count": 0,
"in_reply_to_status_id_str": null,
"id": 249289491129438208,
"geo": null,
"retweeted": false,
"in_reply_to_user_id": null,
"place": null,
"user": {
"profile_sidebar_fill_color": "99CC33",
"profile_sidebar_border_color": "829D5E",
"profile_background_tile": false,
"name": "Thomas John Wakeman",
"profile_image_url": "<a href=http://a0.twimg.com/profile_images/2219333930/Froggystyle_normal.png target=_blank rel=nofollow>http://a0.twimg.com/profile_images/2219333930/Froggystyle_normal.png</a>",
"created_at": "Tue Sep 01 21:21:35 +0000 2009",
"location": "Kingston New York",
"follow_request_sent": null,
"profile_link_color": "D02B55",
"is_translator": false,
"id_str": "70789458",
"entities": {
"url": {
"urls": [{
"expanded_url": null,
"url": "",
"indices": [
0,
0
]
}]
},
"description": {
"urls": [
]
}
},
"default_profile": false,
"contributors_enabled": false,
"favourites_count": 19,
"url": null,
"profile_image_url_https": "<a href=https://si0.twimg.com/profile_images/2219333930/Froggystyle_normal.png target=_blank rel=nofollow>https://si0.twimg.com/profile_images/2219333930/Froggystyle_normal.png</a>",
"utc_offset": -18000,
"id": 70789458,
"profile_use_background_image": true,
"listed_count": 1,
"profile_text_color": "3E4415",
"lang": "en",
"followers_count": 63,
"protected": false,
"notifications": null,
"profile_background_image_url_https": "<a href=https://si0.twimg.com/images/themes/theme5/bg.gif target=_blank rel=nofollow>https://si0.twimg.com/images/themes/theme5/bg.gif</a>",
"profile_background_color": "352726",
"verified": false,
"geo_enabled": false,
"time_zone": "Eastern Time (US & Canada)",
"description": "Science Fiction Writer, sort of. Likes Superheroes, Mole People, Alt. Timelines.",
"default_profile_image": false,
"profile_background_image_url": "<a href=http://a0.twimg.com/images/themes/theme5/bg.gif target=_blank rel=nofollow>http://a0.twimg.com/images/themes/theme5/bg.gif</a>",
"statuses_count": 1048,
"friends_count": 63,
"following": null,
"show_all_inline_media": false,
"screen_name": "MonkiesFist"
},
"in_reply_to_screen_name": null,
"source": "web",
"in_reply_to_status_id": null
}, {
"coordinates": null,
"favorited": false,
"truncated": false,
"created_at": "Fri Sep 21 22:51:18 +0000 2012",
"id_str": "249279667666817024",
"entities": {
"urls": [
],
"hashtags": [{
"text": "freebandnames",
"indices": [
20,
34
]
}],
"user_mentions": [
]
},
"in_reply_to_user_id_str": null,
"contributors": null,
"text": "The Foolish Mortals #freebandnames",
"metadata": {
"iso_language_code": "en",
"result_type": "recent"
},
"retweet_count": 0,
"in_reply_to_status_id_str": null,
"id": 249279667666817024,
"geo": null,
"retweeted": false,
"in_reply_to_user_id": null,
"place": null,
"user": {
"profile_sidebar_fill_color": "BFAC83",
"profile_sidebar_border_color": "615A44",
"profile_background_tile": true,
"name": "Marty Elmer",
"profile_image_url": "<a href=http://a0.twimg.com/profile_images/1629790393/shrinker_2000_trans_normal.png target=_blank rel=nofollow>http://a0.twimg.com/profile_images/1629790393/shrinker_2000_trans_normal.png</a>",
"created_at": "Mon May 04 00:05:00 +0000 2009",
"location": "Wisconsin, USA",
"follow_request_sent": null,
"profile_link_color": "3B2A26",
"is_translator": false,
"id_str": "37539828",
"entities": {
"url": {
"urls": [{
"expanded_url": null,
"url": "<a href=http://www.omnitarian.me target=_blank rel=nofollow>http://www.omnitarian.me</a>",
"indices": [
0,
24
]
}]
},
"description": {
"urls": [
]
}
},
"default_profile": false,
"contributors_enabled": false,
"favourites_count": 647,
"url": "<a href=http://www.omnitarian.me target=_blank rel=nofollow>http://www.omnitarian.me</a>",
"profile_image_url_https": "<a href=https://si0.twimg.com/profile_images/1629790393/shrinker_2000_trans_normal.png target=_blank rel=nofollow>https://si0.twimg.com/profile_images/1629790393/shrinker_2000_trans_normal.png</a>",
"utc_offset": -21600,
"id": 37539828,
"profile_use_background_image": true,
"listed_count": 52,
"profile_text_color": "000000",
"lang": "en",
"followers_count": 608,
"protected": false,
"notifications": null,
"profile_background_image_url_https": "<a href=https://si0.twimg.com/profile_background_images/106455659/rect6056-9.png target=_blank rel=nofollow>https://si0.twimg.com/profile_background_images/106455659/rect6056-9.png</a>",
"profile_background_color": "EEE3C4",
"verified": false,
"geo_enabled": false,
"time_zone": "Central Time (US & Canada)",
"description": "Cartoonist, Illustrator, and T-Shirt connoisseur",
"default_profile_image": false,
"profile_background_image_url": "<a href=http://a0.twimg.com/profile_background_images/106455659/rect6056-9.png target=_blank rel=nofollow>http://a0.twimg.com/profile_background_images/106455659/rect6056-9.png</a>",
"statuses_count": 3575,
"friends_count": 249,
"following": null,
"show_all_inline_media": true,
"screen_name": "Omnitarian"
},
"in_reply_to_screen_name": null,
"source": "<a>Twitter for iPhone</a>",
"in_reply_to_status_id": null
}];
setTimeout(timer, tweets.length == 0 ? 20000 : 0);
return;
}
// Show Next Tweet
var tweet = tweets.pop();
lastTweetId = tweet.id;
console.log('processing tweet # ' + tweet.id);
// Get Coordinates if Needed
if (tweet.geo == null) {
console.log(tweet);
getCoordinates(tweet.user.location, function(lng, lat, succeeded) {
if (succeeded) {
console.log('successfuly geocoded ' + tweet.user.location);
tweet.geo = { coordinates: [lat, lng] };
displayTweet(ge, tweet);
}
else {
console.log('failed to geocode ' + tweet.user.location);
}
});
}
else {
console.log('tweet.geo available: [' + tweet.geo.coordinates[0] + ',' + tweet.geo.coordinates[1] + ']');
displayTweet(ge, tweet);
}
setTimeout(timer, 20000);
})();
}
function displayTweet(ge, tweet) {
// Cleanup Current Balloon (if any)
ge.setBalloon(null);
// Get Current View
var lookAt = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);
// Set New Destination
lookAt.setLatitude(tweet.geo.coordinates[0]);
lookAt.setLongitude(tweet.geo.coordinates[1]);
// Randomize view
lookAt.setTilt(60 + Math.floor(Math.random() * 21));
lookAt.setHeading(Math.floor(Math.random() * 361));
lookAt.setRange(2000.0);
// Update the view in Google Earth (Starts Flying Animation)
ge.getView().setAbstractView(lookAt);
// Wait for the Flying Animation to Stop Before Showing Balloon (~6 secs)
setTimeout(function() {
var placemark = ge.createPlacemark('');
var point = ge.createPoint('');
point.setLatitude(tweet.geo.coordinates[0]);
point.setLongitude(tweet.geo.coordinates[1]);
placemark.setGeometry(point);
var balloon = ge.createHtmlStringBalloon('');
balloon.setFeature(placemark);
balloon.setContentString('<div class="balloon"><div>' + tweet.user.name + (tweet.user.location != null ? ' (' + tweet.user.location + ')' : '') + '</div><div class="text">' + tweet.text + '</div><div class="date">' + tweet.created_at + '</div></div>');
balloon.setCloseButtonEnabled(false);
ge.setBalloon(balloon);
}, 6000);
}
// ]]>
<br>
Here's my latest blog post... I'm saying 'post' instead of 'article' because this is more of a showcase than a tutorial. Code is provided as usual so the learning process is on your side at your will and your pace :)<br>
<br>
What the screensaver actually dipslays is shown above (<a target="_blank" href="http://www.google.com/earth/explore/products/plugin.html">Earth plugin</a> required). <span style="font-weight:bold;">The screensaver is continually fetching the latest North American Tweets containing the #Google Hashtag from Twitter and displays them</span>. Pretty nice!<br>
<br>
</![CDATA[></script><a href="http://blog.mikecouturier.com/2011/07/your-own-google-earth-web-page.html#more">Read more »</a>Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com9tag:blogger.com,1999:blog-8028247505642201389.post-42027144911761420612011-07-10T21:22:00.004-04:002011-10-03T20:46:07.077-04:00SEO Tip: Dynamic Google XML Sitemaps Generation in C#<span style="font-style:italic;">Sitemaps are a way to tell Google about pages on your site we might not otherwise discover. In its simplest terms, a XML Sitemap—usually called Sitemap, with a capital S—is a list of the pages on your website. Creating and submitting a Sitemap helps make sure that Google knows about all the pages on your site, including URLs that may not be discoverable by Google's normal crawling process.</span><br>
<div style="text-align:right;">- <a href="http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156184&from=40318&rd=1" target="_blank">About Sitemaps - Webmaster Tools Help</a></div><br>
<a href="http://blog.mikecouturier.com/2011/07/seo-tip-dynamic-google-xml-sitemaps.html#more">Read more »</a>Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com8tag:blogger.com,1999:blog-8028247505642201389.post-21173506706103063752011-07-03T21:14:00.017-04:002012-02-07T10:52:42.387-05:00Create Zoomable Images Using The Google Maps API<script src="http://maps.google.com/maps/api/js?libraries=geometry&sensor=false" type="text/javascript">
</script><br>
<div class="map" id="earth-map" style="clear: both; height: 350px; width: 400px; margin:0px auto;"></div><script type="text/javascript">
/* <![CDATA[ */
// Google Maps Demo
//////////////////////////////////
var Demo = Demo || {};
Demo.ImagesBaseUrl = 'http://cdn.mikecouturier.com/blog.mikecouturier.com/images/maps-tiles/';
// CroftMap class
//////////////////////////////////
Demo.CroftMap = function (container) {
// Create map
this._map = new google.maps.Map(container, {
zoom: 1,
center: new google.maps.LatLng(0, -20),
mapTypeControl: false,
streetViewControl: false
});
// Set custom tiles
this._map.mapTypes.set('croft', new Demo.ImgMapType('croft', '#4E4E4E'));
this._map.setMapTypeId('croft');
};
// EarthMap class
//////////////////////////////////
Demo.EarthMap = function(container) {
// Create map
this._map = new google.maps.Map(container, { zoom: 0, center: new google.maps.LatLng(0, 0), disableDefaultUI: true });
// Set custom tiles
this._map.mapTypes.set('earth', new Demo.ImgMapType('earth', '#FFF'));
this._map.setMapTypeId('earth');
// Create custom controls & bind events
this._createControls();
this._bindEvents();
};
Demo.EarthMap.prototype._showHome = function() {
var position = new google.maps.LatLng(48.802761, 49.199218);
this._window.open(position, 'This is a house!');
this._map.setZoom(3);
this._map.panTo(position);
};
Demo.EarthMap.prototype._showStars = function() {
var position = new google.maps.LatLng(64.168106, -3.515625);
this._window.open(position, 'You\'re looking at the stars!');
this._map.setZoom(2);
this._map.panTo(position);
};
Demo.EarthMap.prototype._createControls = function() {
var self = this;
// Info window
this._window = new Demo.TextWindow(this._map);
// Plus button
var plusButtonContainer = document.createElement('DIV');
plusButtonContainer.style.margin = '10px 0px 0px 10px';
new Demo.ZoomButtonControl(plusButtonContainer, this._map, 1);
// Minus button
var minusButtonContainer = document.createElement('DIV');
minusButtonContainer.style.margin = '0px 0px 0px 10px';
new Demo.ZoomButtonControl(minusButtonContainer, this._map, -1);
// Zoom levels
var zoomLevelsContainer = document.createElement('DIV');
zoomLevelsContainer.style.margin = '4px 0px 4px 10px';
new Demo.ZoomLevelsControl(zoomLevelsContainer, this._map);
// Some buttons
var buttonsContainer = document.createElement('DIV');
buttonsContainer.style.margin = '0px 10px 0px 0px';
google.maps.event.addDomListener(buttonsContainer, 'mouseover', function() {
Demo.Utils.SetOpacity(buttonsContainer, 100);
});
google.maps.event.addDomListener(buttonsContainer, 'mouseout', function() {
Demo.Utils.SetOpacity(buttonsContainer, 75);
});
Demo.Utils.SetOpacity(buttonsContainer, 75);
new Demo.ImageControl('star.png', buttonsContainer, this._map, function() { self._showStars(); });
new Demo.ImageControl('home.png', buttonsContainer, this._map, function() { self._showHome(); });
// Push every controls into the map
this._map.controls[google.maps.ControlPosition.LEFT_CENTER].push(plusButtonContainer);
this._map.controls[google.maps.ControlPosition.LEFT_CENTER].push(zoomLevelsContainer);
this._map.controls[google.maps.ControlPosition.LEFT_CENTER].push(minusButtonContainer);
this._map.controls[google.maps.ControlPosition.RIGHT_CENTER].push(buttonsContainer);
};
Demo.EarthMap.prototype._bindEvents = function() {
var self = this;
google.maps.event.addListener(this._map, 'click', function() {
self._window.close();
});
};
// ImgMapType class
//////////////////////////////////
Demo.ImgMapType = function(theme, backgroundColor) {
this.name = this._theme = theme;
this._backgroundColor = backgroundColor;
};
Demo.ImgMapType.prototype.tileSize = new google.maps.Size(256, 256);
Demo.ImgMapType.prototype.minZoom = 0;
Demo.ImgMapType.prototype.maxZoom = 5;
Demo.ImgMapType.prototype.getTile = function(coord, zoom, ownerDocument) {
var tilesCount = Math.pow(2, zoom);
if (coord.x >= tilesCount || coord.x < 0 || coord.y >= tilesCount || coord.y < 0) {
var div = ownerDocument.createElement('div');
div.style.width = this.tileSize.width + 'px';
div.style.height = this.tileSize.height + 'px';
div.style.backgroundColor = this._backgroundColor;
return div;
}
var img = ownerDocument.createElement('IMG');
img.width = this.tileSize.width;
img.height = this.tileSize.height;
img.src = Demo.Utils.GetImageUrl(this._theme + '/tile_' + zoom + '_' + coord.x + '-' + coord.y + '.png');
return img;
};
// ZoomButtonControl class
//////////////////////////////////
Demo.ZoomButtonControl = function(container, map, level) {
var button = document.createElement('IMG');
button.style.cursor = 'pointer';
button.src = Demo.Utils.GetImageUrl(level > 0 ? 'plus.png' : 'minus.png');
container.appendChild(button);
google.maps.event.addDomListener(button, 'click', function() {
map.setZoom(map.getZoom() + level);
});
};
// ImageControl class
//////////////////////////////////
Demo.ImageControl = function(image, container, map, callback) {
var button = document.createElement('IMG');
button.style.cursor = 'pointer';
button.style.display = 'block';
button.src = Demo.Utils.GetImageUrl(image);
container.appendChild(button);
google.maps.event.addDomListener(button, 'click', function() {
callback();
});
};
// ZoomLevelsControl class
//////////////////////////////////
Demo.ZoomLevelsControl = function(container, map) {
this._container = container;
this._map = map;
this._buildUI();
this._updateUI();
this._bindZoomEvent();
};
Demo.ZoomLevelsControl.prototype._buildUI = function() {
var currentMapType = this._map.mapTypes.get(this._map.getMapTypeId());
for (var i = currentMapType.maxZoom; i >= currentMapType.minZoom; i--) {
var level = document.createElement('IMG');
level.style.cursor = 'pointer';
if (i != currentMapType.minZoom)
level.style.marginBottom = '2px';
level.style.display = 'block';
level.src = Demo.Utils.GetImageUrl('level.png');
this._bindLevelClick(level, i);
this._container.appendChild(level);
}
};
Demo.ZoomLevelsControl.prototype._updateUI = function() {
var currentMapType = this._map.mapTypes.get(this._map.getMapTypeId());
var currentZoom = this._map.getZoom();
var levelsCount = currentMapType.maxZoom - currentMapType.minZoom;
for (var i = 0; i < levelsCount; i++)
Demo.Utils.SetOpacity(this._container.childNodes[i], (currentMapType.maxZoom - i) <= currentZoom ? 100 : 30);
};
Demo.ZoomLevelsControl.prototype._bindZoomEvent = function() {
var self = this;
google.maps.event.addListener(this._map, 'zoom_changed', function() {
self._updateUI();
});
};
Demo.ZoomLevelsControl.prototype._bindLevelClick = function(bar, zoom) {
var self = this;
google.maps.event.addDomListener(bar, 'click', function() {
self._map.setZoom(zoom);
});
};
// TextWindow class
//////////////////////////////////
Demo.TextWindow = function(map) {
this._map = map;
this._window = null;
this._text = null;
this._position = null;
};
Demo.TextWindow.prototype = new google.maps.OverlayView();
Demo.TextWindow.prototype.open = function(latlng, text) {
if (this._window != null)
this.close();
this._text = text;
this._position = latlng;
this.setMap(this._map);
};
Demo.TextWindow.prototype.close = function() {
this.setMap(null);
};
Demo.TextWindow.prototype.onAdd = function() {
this._window = document.createElement('DIV');
this._window.style.position = 'absolute';
this._window.style.cursor = 'default';
this._window.style.padding = '40px 20px 0px 20px';
this._window.style.textAlign = 'center';
this._window.style.fontFamily = 'Arial,sans-serif';
this._window.style.fontWeight = 'bold';
this._window.style.fontSize = '12px';
this._window.style.width = '88px';
this._window.style.height = '88px';
this._window.style.background = 'url(' + Demo.Utils.GetImageUrl('window.png') + ')';
this._window.innerHTML = this._text;
this.getPanes().floatPane.appendChild(this._window);
};
Demo.TextWindow.prototype.draw = function() {
var point = this.getProjection().fromLatLngToDivPixel(this._position);
this._window.style.top = (parseInt(point.y) - 128) + 'px';
this._window.style.left = (parseInt(point.x) - 110) + 'px';
};
Demo.TextWindow.prototype.onRemove = function() {
this._window.parentNode.removeChild(this._window);
this._window = null;
};
// Other
//////////////////////////////////
Demo.Utils = Demo.Utils || {};
Demo.Utils.GetImageUrl = function(image) {
return Demo.ImagesBaseUrl + image;
};
Demo.Utils.SetOpacity = function(obj, opacity /* 0 to 100 */) {
obj.style.opacity = opacity / 100;
obj.style.filter = 'alpha(opacity=' + opacity + ')';
};
// Map creation
//////////////////////////////////
google.maps.event.addDomListener(window, 'load', function(){
var earthMap = new Demo.EarthMap(document.getElementById('earth-map'));
});
/* ]]> */
<br>
<br>
I visited the <a href="http://www.google.com/intl/en-US/+/demo/" target="_blank">Google+ Project</a> website the other day and to my surprise, it was powered by the Google Maps engine! It is somewhat creative to re-use the Maps engine for any purpose other than mapping. It is just beautiful.<br>
<br>
It also reminds me of the <a href="http://www.googleartproject.com/" target="_blank">Art Project</a> I've seen a while back that uses the Street View engine. A must see.<br>
<br>
Anyways, I'm pleased to show you two samples today: they both let you navigate into an image using the Google Maps engine. I'm also giving up the necessary tools to do it yourself. Enjoy!<br>
<br>
</![CDATA[></script><a href="http://blog.mikecouturier.com/2011/07/create-zoomable-images-using-google.html#more">Read more »</a>Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com108tag:blogger.com,1999:blog-8028247505642201389.post-55029328604922934232011-06-22T14:51:00.002-04:002011-07-06T10:07:31.466-04:00Is Google Maps API v3 Down?(Today June 22nd 2011, 2:50PM)<br />
<br />
There's a problem with the Maps API v3: The inclusion of the main file is ok:<br />
<br />
<pre class="prettyprint">http://maps.google.com/maps/api/js?sensor=false&language=en
</pre><br />
But it turns out it includes another file which is currently not found:<br />
<br />
<pre class="prettyprint">http://maps.gstatic.com/intl/en_ALL/mapfiles/api-3/5/7/main.js
</pre><br />
Anyone else experiencing this?Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com11tag:blogger.com,1999:blog-8028247505642201389.post-63454228631752438342011-06-07T23:45:00.002-04:002011-10-03T00:18:12.900-04:00Happy Father's Day 2011!"Father's Day is a celebration honoring fathers and celebrating fatherhood, paternal bonds, and the influence of fathers in society."<br />
<i>- http://en.wikipedia.org/wiki/Father's_Day</i><br />
<br />
Don't wait till it's too late to express your love to your father! Like me, you might be interested to some deals on <div class="las-ad" data-id="amazon-lnk-general"></div>! Plus, in doing so, you'll support my efforts in bringing more and more articles online! Thanks!<br />
<br />
<div style="text-align:center;"><div class="las-ad" data-id="amazon-deals-336x280"></div></div>Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com0tag:blogger.com,1999:blog-8028247505642201389.post-21117594130125137592011-03-30T19:29:00.006-04:002011-05-29T14:43:48.672-04:00HTML Validation: Let Your Browser Be The Markup Validator!Here's a quick article on XHTML conformance. Learn how to serve your pages in ASP.NET with another content-type to make your browser stop on any parsing error.<br>
<br>
Read on!<br>
<br>
<a href="http://blog.mikecouturier.com/2011/03/html-validation-let-your-browser-be.html#more">Read more »</a>Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com3tag:blogger.com,1999:blog-8028247505642201389.post-12070102699826881972011-03-20T21:48:00.006-04:002011-07-03T21:15:53.934-04:00FIX: jQuery JSONP request to the Google Maps API Geo ServiceA lot of you guys (including me) had a problem with the Maps Geocoding API. Google seems to have dropped the JSONP feature of their library. Well they still support it (otherwise their own client library would not work) and here's a fix.<br>
<br>
Note: this applies to v2 only.<br>
<br>
<a href="http://blog.mikecouturier.com/2011/03/fix-jquery-jsonp-request-to-google-maps.html#more">Read more »</a>Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com3tag:blogger.com,1999:blog-8028247505642201389.post-36011993759745653202011-03-19T10:32:00.006-04:002011-05-29T14:52:04.658-04:00Uncommitted Reads in LINQ: Avoiding Deadlocks and Timeouts!This short post today is about a performance enhancement in LINQ to SQL: Reading uncommitted data. You have to know that it's not a LINQ to SQL concept but a straight SQL Server concept. <br>
<br>
But read on to know how they relate to each other.<br>
<br>
<a href="http://blog.mikecouturier.com/2011/03/uncommitted-reads-in-linq-avoiding.html#more">Read more »</a>Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com2tag:blogger.com,1999:blog-8028247505642201389.post-27902817795985964422011-03-14T23:17:00.015-04:002011-10-03T20:58:37.933-04:00ASP.NET Web Forms versus .NET MVC: Comparing apples with.. really old applesI'll say it up front, I'm tired of using Web Forms :) I'm a professional web architect (it sounds huge, no it's not. I just do that for a living) and I personally think that it's a counter intuitive framework to deal with. I can't do MVC often since nobody around me is using it (I'm not mad at that fact by the way). But it's a shift I'd like we do, and why we should do it is the main goal of this article.<br>
<br>
So walk through the light Homer!<br>
<br>
<a href="http://blog.mikecouturier.com/2011/03/aspnet-web-forms-versus-net-mvc.html#more">Read more »</a>Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com29tag:blogger.com,1999:blog-8028247505642201389.post-2963561449272258632010-09-13T16:53:00.007-04:002011-06-16T20:43:41.990-04:00Nexus One in Canada - APN settings for 3G with VideotronI've managed to get the APN and MMS settings for Videotron Mobile.<br>
<br>
Here's my story...<br>
<br>
<a href="http://blog.mikecouturier.com/2010/09/google-nexus-one-in-canada-3g-with-t.html#more">Read more »</a>Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com13tag:blogger.com,1999:blog-8028247505642201389.post-4681471994343400722010-03-11T16:13:00.009-05:002011-05-29T14:47:25.608-04:00A new contributor updated bitly-dot-net, my .NET wrapper around the bit.ly APIThis post is about the changes made to "my" library by Noah Blumenthal, the Lead Microsoft Developer of PC Magazine.<br>
<br>
See the improvements...<br>
<br>
<a href="http://blog.mikecouturier.com/2010/03/new-contributor-updated-bitly-dot-net.html#more">Read more »</a>Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com7tag:blogger.com,1999:blog-8028247505642201389.post-74257321126412462052010-03-02T21:40:00.011-05:002011-05-29T14:47:41.243-04:00IoC Containers With .NET MVC - Understand Current Ones by Building your OwnThis article shows you how to create your own IoC Container from a to z and how to use it with .NET MVC. This is mainly for educational purpose so I suggest you use an existing solution available on the Internet. See links at the end of the article. Last thing to note, I'm assuming you're familiar with .NET MVC<br>
<br>
<a href="http://blog.mikecouturier.com/2010/03/ioc-containers-with-net-mvc-understand.html#more">Read more »</a>Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com6tag:blogger.com,1999:blog-8028247505642201389.post-51052465868747347612010-02-28T21:36:00.004-05:002011-05-29T14:53:55.010-04:00Congratulations to Team Canada!Some of you may not know it but I'm from Canada and a big hockey fan.<br>
<br>
<a href="http://blog.mikecouturier.com/2010/02/congratulations-to-team-canada.html#more">Read more »</a>Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com0tag:blogger.com,1999:blog-8028247505642201389.post-58588540300808508362010-02-22T21:31:00.022-05:002011-10-03T21:02:03.605-04:00Beginning with jQuery - A Solid Foundation to Learn The BasicsIt's been a while since my last article and I'm very pleased to come up with this one.<br>
<br>
Enjoy.<br>
<br>
<a href="http://blog.mikecouturier.com/2010/02/beginning-with-jquery-solid-foundation_22.html#more">Read more »</a>Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com48tag:blogger.com,1999:blog-8028247505642201389.post-64704928978043556392010-01-31T18:51:00.003-05:002011-05-29T14:54:09.729-04:00I've Released an Update on Poker PlannerHi,<br>
<br>
Yes it's been a long time since I published an article on my blog.. but I was busy coding an update for my web site Poker Planner.<br>
<br>
But I just put it online now so I'll be able to write some stuff...<br>
<br>
<a href="http://blog.mikecouturier.com/2010/01/ive-released-update-on-poker-planner.html#more">Read more »</a>Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com0tag:blogger.com,1999:blog-8028247505642201389.post-22754537172532651872010-01-15T14:17:00.002-05:002011-04-08T20:45:49.120-04:00jQuery 1.4 Released!I'm a little late with this because I was in NYC yesterday but I heard today from a co-worker that jQuery 1.4 is out!<br>
<br>
<a href="http://blog.mikecouturier.com/2010/01/jquery-14-released.html#more">Read more »</a>Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com0tag:blogger.com,1999:blog-8028247505642201389.post-50020633243059563212010-01-12T22:11:00.007-05:002011-05-29T14:52:24.507-04:00SQL 2008 TVP (Table Valued Parameters) and LINQ - It is Possible! (Sorta)I'm sure you saw all those blog posts about SQL Server's TVP (table valued parameters) so I'll be brief and I won't go into much details.<br>
<br>
<a href="http://blog.mikecouturier.com/2010/01/sql-2008-tvp-table-valued-parameters.html#more">Read more »</a>Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com16tag:blogger.com,1999:blog-8028247505642201389.post-54799896251638449872010-01-04T18:25:00.004-05:002011-05-29T14:54:24.306-04:00It's Official, I'm the 32nd Google JS Maps API Certified Developer!<div class="separator" style="clear: both; text-align: center;"><img border="0" alt="the google maps api certified developer logo" src="http://1.bp.blogspot.com/_ypRgbP-iK9s/S0J2RkHCPJI/AAAAAAAAAtM/jWHL4cpwfaM/s320/logo_qd_large.gif"><br>
</div><br>
<a href="http://blog.mikecouturier.com/2010/01/its-official-im-32th-google-js-maps-api.html#more">Read more »</a>Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com0tag:blogger.com,1999:blog-8028247505642201389.post-57308988197157128962010-01-03T21:42:00.008-05:002011-04-08T23:01:06.043-04:00Creating Custom Exceptions in .NET - Real World ScenariosHere's an article I've written about custom exceptions. It's not only about custom exceptions per se, it's also about using them when you have interfaces.<br>
<br>
Enjoy<br>
<br>
<a href="http://blog.mikecouturier.com/2010/01/creating-custom-exceptions-in-net-right.html#more">Read more »</a>Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com10tag:blogger.com,1999:blog-8028247505642201389.post-3765606542623835102009-12-30T23:24:00.013-05:002011-07-03T21:16:09.496-04:00Google Maps API and jQuery - Tips to Avoid Using BothI often get visits on my blog from search engines with keywords like "google maps jquery". It made me realize that jQuery is now deeply anchored in our habits.<br>
<br>
Then I was reviewing some stuff in the Google API the other day and I saw that the API has much to offer, we just don't know it.<br>
<br>
<a href="http://blog.mikecouturier.com/2009/12/google-maps-api-and-jquery-tips-to.html#more">Read more »</a>Anonymoushttp://www.blogger.com/profile/15824339719026497535noreply@blogger.com6