Use Google Maps to Display Dynamic Content-.yVSy

Version 3

    Google has made it much easier to map your data with their new V3 API. This was my first attempt at dynamically adding content.

     

    The code sample includes actions for hover, click, and double-click. Include isdraggable=true in the url to move the points. Use the filter parameter with an escaped where clause (like filter=StatusLED%3D'Down.gif') to limit the nodes returned.

    Make sure Internet Explorer is not in Compatibility Mode when viewing the page. Funny things happen.

    Google terms and conditions require free public access to the maps. Don't charge people to use it. Don't place it behind a firewall. Nothing is mentioned about burying the url where nobody will stumble across it, but do so at your own discretion. Google also has a paid-for service if you want to keep your data private.

    Visit http://code.google.com/apis/maps/ to find out more about the Google Maps API.

    Visit http://code.google.com/apis/maps/terms.html to find out more about the terms of service.


    I found the icons and some of the original code here on the Content Exchange. I wish I could remember where I found it. Whoever you are, thank you!

    My coding skills are still pretty weak. I won't be able to offer any help with deploying the solution. Please add comments for design improvements or deployment tips.


    UPDATE (5/10/2012): I've made a few changes to make implementation easier. The only custom fields left are Lattitude and Longitude. There's also a web.config file to allow full access (no login required) and redirect to DisplayMap.aspx.

    1. Make sure you have Lattitude and Longitude as custom fields for your Nodes. You might also want to default their values to 0.
    2. Edit the connectionString in DisplayXML.aspx.cs and UpdateLatLng.aspx.cs so you can connect to your database.
    3. Edit the initialize function in DisplayMap.aspx to center on you. Currently set to (30.245575, -97.805738).
    4. Create a virtual directory through IIS.

    UPDATE (6/25/2012): Google has lowered their pricing. If you're interested in keeping your personal maps personal, then this is the way to go. The price has been dropped from $4 per 1,000 map loads to $0.50 per 1000 map loads (1/8th the original price). You can view the Google Geo Developers Blog for more details.