Jérôme Laban

.NET Powered

Pocket IE and Setting IMG Src via JavaScript

clock September 7, 2008 09:28 by author Jay

Cet article est disponible en francais ici.

With the Montreal's Bus Stop Locator web site, to be able to use Google Maps effectively, it's imperative to let the client's browser fetch the image by itself. The Google API does not allow a single key to grab a lot of maps from a single host, so redirecting the image is not an option.

I wanted to have the image Url generated so I could use the Width of an HTML body to be embedded in the Map query, so I created a small script that builds the URL and sets as the SRC of the IMG element that will contain the Map.

Well, that seems easy, but it's not... The IMG does fetch the image, but the element's size is not updated with the size of the new image.

In my case, I'm placing the image in a TABLE element, so I'm getting the default cell size for my image. To fix that I also had to set the width and height of the IMG element, to get it to have a proper size.

PocketIE has little support for scripting, but it's somehow clear that it has been a hard to fit addition to the engine... Come on microsoft ! You can do better than that ! Have a look at what Opera's been doing...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Montreal Bus Stop Locator Site Updates

clock September 7, 2008 09:06 by author Jay

Cet article est disponible en français ici.

So far, the response has been great for my little utility, even though I'm not making an active advertising.

Using some Microsoft terminology, I'm dogfooding my own application and I found a few points that could be enhanced a bit :

  • Now, if using Google Gears, you are not automatically redirected to the stop list for your location. You simply see a small map of where you're supposed to be, and you're offered a other button to choose to use that location.
  • Some error messages are displayed when typing incorrect or missing data. That could be confusing...
  • All maps are now using all the available width of the screen. That means that the image is not resized poorly on a mobile device. Still, I wonder how the iPhone wil behave with this...
  • I fixed a bit the distance display to display Km instead of meters if appropriate, even though if you are in an other city, you'll still be offered some reaaaally long distance.
    I'm still wondering if I need to filter out people that are outside Montreal. The point of this site is also to be a technological proof-of-concept for GeoLocation, so even if the distance is not usable, it's still a valuable information.
  • I've also added some street name samples to help people that are not from Montreal to see what the site can do. I've taken a random intersection and bus stop code that can be typed in directly.
  • I also made some XHTML compliance, for what it's worth :)

Now, I think I'll try to make sure that Google search will find the site in both French and English languages because right now, I'm having the same problems I did have with my Remote Control software pages. Google's crawling without specifying a language, so for this site, English is going to come out, since it is the default language. Maybe I'll add a "/fr" and "/en" virtual base for each of them.

I'm always interested in any suggestions or bug reports !

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


.NET 2.0 InternalsVisibleTo Attribute and Unsigned Assemblies

clock September 2, 2008 07:19 by author Jay

Ce post est disponible en francais ici.

In a recent project, for the purpose of unit testing, I had to use the InternalsVisibleTo attribute, which extends the scope of the internal qualifier. This allows the separation of the unit testing code assembly from the actual code, without publishing the internals to the "public". This way, you can avoid shipping your unit testing code.

This is an interesting attribute from many points of view, but when using it, you may face this nice error message :

error CS1726: Friend assembly reference 'Dummy' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

Problem was, my current assembly nor the target assemblies were signed. I tried adding a dummy PublicKey or PublicKeyToken as indirectly suggested here and here, but as many people out here, I don't want to mess with assembly signing at this point of my project.

It turns out that the compiler considers your assembly as "signed" if there is either an AssemblyKeyFile or AssemblyKeyName defined on the assembly, even though both of them are empty. 

So, to be able to use AssemblyKeyName InternalsVisibleTo with unsigned assemblies, just remove AssemblyKeyFile or AssemblyKeyName attributes if you don't use them.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


About me

My name is Jerome Laban, I am a Software developer and .NET enthustiast from Montréal, QC. You will find my blog on this site, where I'm adding my thoughts on current events, or the things I'm working on, such as the Bluetooth Remote Control Software for Windows Mobile.

© Copyright 2008

Links

Advertizing

Search

Categories


Tags

Calendar

<<  November 2008  >>
SuMoTuWeThFrSa
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

Archive

Blogroll

Sign in