Posts with tag events

Where is MapQuest

Continuing our string of weekly trade show announcements, we'd like to let you know that MapQuest is a Platinum Sponsor of and will be attending the annual Where 2.0 Conference being held next week in Burlingame, CA from May 12th to the 14th. (For those of you not familiar with the Valley, the show is right outside the San Francisco Airport.)

If you're attending the show, stop by and tell us what you're working on and how MapQuest can help.

Meet Us at JavaOne

MapQuest will be in attendance at JavaOne being held next week at the Moscone Center in San Francisco, CA. You can visit us in the Pavilion at booth #1124; a number of the MapQuest Developers will also be running around and attending sessions. Feel free to stop and talk with us.

Visit Us at Location Intelligence

MapQuest will be out in Santa Clara, CA this week attending the Location Intelligence conference. We have a booth set-up and will be happy to demo and discuss the MapQuest Platform with you.

Hope to see you there!

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.

Continue reading Create a Geo File

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.

Continue reading Adding Rollover Functionality to Overlays: Part 2

More Overlay Events

Custom events are also a great way to 'clean up' the look of your maps. In most of my previous MapQuest posts, I've been only loading a single overlay or polyline at a time. Chances are, you'll encounter the need to load more than one at a time - but also don't want to clutter up the look of the map by having them all visible at the same time.

Here's an example where I've loaded two different polylines from different GeoRSS/GML files. Instead of having both automatically displayed on the map, I'm going to use a mousever event on a POI to display the polyline. Two do so, I create two POIs has a legend to each polyline. On a 'mouseover' event I load and display the appropriate file. On a 'mouseout' event the overlay is set to not be visible.

<html>
<head>
<title>Overlay Events</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"></script>
<script language="javascript">
MQInitDojo(initMap);
var myOverlayColl = new MQOverlayCollection();
var myXMLDoc;
function openXMLFile1(){
    myXMLDoc = document.implementation.createDocument("","",null);
    myXMLDoc.load("./foo1.xml");
    myXMLDoc.onload = loadGeoRSS;
}
function openXMLFile2(){
    myXMLDoc = document.implementation.createDocument("","",null);
    myXMLDoc.load("./foo2.xml");
    myXMLDoc.onload = loadGeoRSS;
}
function loadGeoRSS() {
    myOL = new MQLineOverlay();
    for (i = 0; i < myXMLDoc.getElementsByTagName("entry").length; i++) {
        var c = myXMLDoc.getElementsByTagNameNS("http://www.opengis.net/gml",
         "posList")[i].textContent;
        var tmp = c.split(/ /);
        var myShapePts = new MQLatLngCollection();
        for (j = 0; j > tmp.length; j++) {
            myShapePts.add(new MQLatLng(tmp[j], tmp[j+1]));
            j++;
        }
        myOL.setShapePoints(myShapePts);
        myOverlayColl.add(myOL);
        myMap.replaceOverlays(myOverlayColl);
	myOL.setColor("#800000");
        myOL.setBorderWidth(1);
	myOL.setColorAlpha(1.0);
    }
}
function loadData() {
    myPoint1 = new MQPoi(new MQLatLng(33.305389, -116.879258));
    myPoint1.setInfoTitleHTML("Palomar Mountain South Grade");
    myMap.addPoi(myPoint1);
    MQEventManager.addListener(myPoint1,'mouseover', openXMLFile1);
    MQEventManager.addListener(myPoint1,'mouseout', clear);

    myPoint2 = new MQPoi(new MQLatLng(33.288569, -116.805051));
    myPoint2.setInfoTitleHTML("Palomar Mountain East Grade");
    myMap.addPoi(myPoint2);
    MQEventManager.addListener(myPoint2,'mouseover', openXMLFile2);
    MQEventManager.addListener(myPoint2,'mouseout', clear);
}
function clear() {
    myOL.setVisible(false);
}
function initMap() {
   myMap = new MQTileMap(document.getElementById('mapDiv'),
     8,new MQLatLng(33.272866, -116.831869));
   myMap.addControl(new MQLargeZoomControl(myMap));
   loadData();
}
</script>
</head>
<body>
<div id="mapDiv" style="width:384px; height:384px; border:2px solid"></div>
</body>
</html>

Here's a screenshot of the results:

More resources:

* Map data courtesy SundayMorningRides.com

South By Southwest 2008 Recap

Thank you Austin!

We just got back from a great couple of days at SXSW Interactive where we announced our new MapQuest Platform: Free Edition.

It was great to talk with developers and that people were excited to see us doing our part to rock Austin, TX. We also got to make a lot of new friends at the show and other events around town. We showed off a bunch of demos in the booth and in case you missed your flight or otherwise wanted to check them out further, you can currently find them here: MapQuest Platform: SXSW Demos. You can download the code samples to help you get started on your own applications from that page as well.

SXSW Demo Screenshot

We also would like to thank everyone at SXSW Interactive, all of the organizers and sponsors of the SXSW Geeks Love Bowling Event and of course everyone who came by to talk to us. We appreciate all the feedback, support and can't wait to see you all next year.

One last thing...

Remember that our Platform is much better than our bowling:

Meet Us At SXSW!

I'm writing about one show while I'm attending another. I'm in the beautiful city of Miami at the Future of Web Apps conference. As this show is winding down from a great day of learning, meeting, networking and demoing, people are already talking about next big migration of developers and technophiles: The South By Southwest Interactive Festival in Austin, Tx.

I used to live in Austin and I love when I have the opportunity to come back. This year when I visit, my MapQuest colleagues and I are also bringing a cool booth, some swag and most importantly some exciting, ground-breaking, game changing, super fantastic things to share and tell you. (Okay, I may have oversold that last part a little, but you will dig it.)

Oh yeah, we're also on a Geeks Love Bowling team.

So if you're heading to South By Southwest, please make sure you swing by our booth between Sunday, March 9th to Tuesday, March 11th. We look forward to meeting and chatting with you! If you're not going, keep reading this blog and the blogs of everyone who is going and having all kinds of fun that you're not.

See you there (or not)!