blogs

Zoom Levels and Image Overlays

In this post I will continue my discussion of overlays in the MapQuest JavaScript API 5.2. My last two posts covered a couple of methods for adding rollover functionality to overlays. Over the next couple of posts I will discuss some of the options that are available when working with image overlays.

There are a few things that set image overlays apart from the other overlay types. The one that poses the biggest obstacle is image resolution. Since an image overlay is "pinned" to a map with Lat and Lng coordinates, there is a significant difference in resolution required to display an image properly at different zoom levels. If this becomes an issue for your application, one of the options that is available is the setImageOverlayLevels method provided by the API.

More on Userplane Desktop Authentication

Treat your password like your toothbrush. Don't let anybody else use it, and get a new one every six months. - Clifford Stoll

This week I wanted to give a plug to my Userplane Desktop article that was just published, and talk just a bit more about how easy it really is to integrate Userplane Desktop authentication with your community. Userplane Desktop allows web communities to extend their presence beyond just their web site, pushing updates to user when they're made available.

Using Map Overlays with Flex and the Mapquest 5.2 APIs

Ok, I was driving (very carefully, mind you) on a very sunny afternoon to the airport, and I got a call from my very bright and brilliant niece who recently enrolled into Michigan State University (MSU if you're a Michigan native). During the midpoint of the conversation, all I heard was "cell phone silence", for lack of a better term, and within a few more seconds the call was dropped -- argh!

Obviously, I'm not the only person in the world who gets aggravated when a mobile call gets dropped. Of course, my wireless carrier has to go unnamed here in order to protect the guilty... er, uh... innocent.

Create a Geo File

In my previous MapQuest posts I've mostly been demonstrating how to use MapQuest to display the the various types of geo-formats (KML, GeoRSS, etc). Building on the examples of map event interaction from my previous posts, we can also build an interactive map interface where users can build their own geo-format files. Here's an example where users can interactively click on the map to create a polyline.


<html>
<head>
<title>Create a Geo File</title>
<script src="http://btilelog.access.mapquest.com/tilelog/transaction?
  transaction=script&key=YOUR-API-KEY&ipr=true&itk=true&v=5.2.0"
  type="text/javascript">&t;/script>
<script language="javascript">

MQInitDojo(initMap);
var myOverlayColl = new MQOverlayCollection();
var myShapePts = new MQLatLngCollection();
var myOL = new MQLineOverlay();
var allclicks  = new Array(0);
function showClick(event) {
    // log all clicks
    allclicks.push(event.ll.getLatitude(), 
      event.ll.getLongitude());
    // add clicks to polyline overlay
    myShapePts.add (new MQLatLng(event.ll.getLatitude(), 
     event.ll.getLongitude()));
    myOL.setShapePoints(myShapePts);
    myOverlayColl.add(myOL); 
    myMap.replaceOverlays(myOverlayColl); 
    // clear previous markers and add new start and end points
    myMap.removeAllPois()
    myMap.addPoi(new MQPoi(new MQLatLng(allclicks[0], allclicks[1])));
    if ( allclicks.length > 1 ) {
        myMap.addPoi(new MQPoi(new 
         MQLatLng(allclicks[allclicks.length-2],
         allclicks[allclicks.length-1])));
    }
}
function display() {
    alert (allclicks);
}
function initMap() {
   myMap = new MQTileMap(document.getElementById('mapDiv'),8,
    new MQLatLng(33.173676, -116.714889));
   myMap.addControl(new MQLargeZoomControl(myMap));
   MQEventManager.addListener(myMap,"click",showClick);
}
</script>
</head>
<body>
<div id="mapDiv" style="width:384px; height:384px; border:2px solid"></div>
<a href="#" onclick="display();">Display Coordinates</a>
</body>

</html>

As you can see, I'm simply using an 'alert' to display the captured latitudes and longitudes of the polyline that the user created. Obviously the next task is to transform that array of coordinates into your favorite geo-format. Here is a screenshot of the result:

Share-A-Map AIM Plugin

Developer David Bello has written a great plug-in for AIM called "Share-a-Map." That clever name may have something to do with why we're covering it here.

Right from the copy in the AIM Gallery:

Share-a-map is an AOL AIM plugin that let you share maps with a friend via AIM in an interactive way. This plugin can be extremely useful when you want to share a location, route or place with a friend or relative, plus other features like add images and hand drawing overlays, find an address or point, save your map, among others.

We've been playing with it here in the office and it is a really sweet way to do some map collaboration.

AOL Open Voice embraces industry standards

AOL has opened up it's AOL Voice Services by offering the Open Voice API. This API allows any client application which supports the following industry standards to 'just work' with AOL Voice Services:

  • RFC 3261 - Session Initiation Protocol
  • RFC 2833 - RTP Payload for DTFM Digits, Telephony Tones and Telephony Signals
  • RFC 4028 - Session Timers in SIP
  • ITU-T E.164 - Formatted Telephone Numbers
  • RFC 2617 - Basic and Digest Access Authentication

Adding Rollover Functionality to Overlays: Part 2

This method, although similar to the method I covered in my last post, uses the InfoWindow of the map rather than a rollover associated with a Point Of Interest (POI). The InfoWindow is populated with the title and content when the overlay is moused-over, and follows the cursor, similar to a tooltip.

The biggest disadvantage with this method comes from the need to step outside of the API to attach a mousemove event. This means that the solution needs to take browser differences into consideration. In order to simplify the code, and because I generally use ASP.NET for most of my work, you will notice that I have utilized a few shortcuts provided by the Microsoft AJAX Library.

Publish Existing Flash Content Fast With yourminis

True enthusiasm is a fine feeling whose flash I admire where-ever I see it. - Charlotte Bronte

You can publish existing Flash content with no coding changes at all! This will give you access to the yourminis widget reporting and syndication. It's as simple as 1-2-3!

Map It! - Building a MapQuest Mac OS X Dashboard Widget - Part 5 - Enhancing Map It!

It is not down in any map; true places never are. - Herman Melville

In Part 1 I showed you how to get started with the MapQuest Platform by getting a developer key. In Part 2, I put that key to use by providing access to a basic map in the Map It! widget. Part 3 showed you how to incorporate basic geocoding. In Part 4 I discussed more advanced geocoding topics - including handling multiple matches and specifying geocode search options. In this installment I'll discuss adding some options to the widget. Specifically I'll discuss setting the default zoom level when adding an API, specifying point of interest icons, and the default map type.

More Spicing up a Facebook Application with Userplane

Nature provides a free lunch, but only if we control our appetites.” - William Ruckelshaus

In my last post, I showed how to integrate Userplane's Webchat client into a Facebook application. I used the Instant Install version of the client, which made the integration straightforward. Lately I've been turning my attention to the Integrated version of the Userplane client.

Syndicate content