Mystery Incorporated


Programming, photography, news, culture, and cartoons

home | rss | atom

Add to Google
tag: GoogleMaps

Mapping the Google Places API


May 1st, 2014 | no comments    

Yelp and Google Places offer competing versions of the same service, as do their APIs. I created the Places Mapper to be able to compare the two. It borrows the same interface as the Yelp Mapper. One difference is that the Yelp API uses text-based searches, while the Places API lets you use their taxonomy of types of businesses. So, you are limited to Google’s choice of what types of places are available, but the results are more accurate. It’s similar to the Metro Places app, but of course you aren’t limited to searching near Metro stations; the entire map is used as the bounds for the search. The API doesn’t return more than 20 results, so if the map covers too large an area, not all relevant places will be returned. » Continue Reading…

How to Get the Coordinates of Any Point


June 8th, 2013 | no comments    

I work with maps a lot, and always need to figure out the latitude and longitude of a point. My go-to method has been Google Maps, but it seems that the next version of Google Maps will not have this feature.

In the current version, you can right-click on the map and select “What’s here?” from the menu. It’ll then put the latitude and longitude in the search box. The new version doesn’t have a right-click menu at all (at least not the current preview version).

I wrote a little app called Spot Picker to let you quickly find the coordinates for any spot. The program is super-simple; there a “Places Autocomplete” field that lets you quickly enter the name of a place to zoom to. Or, just zoom and pan using the normal map controls. As you move your mouse over the map, the latitude and longitude appear on the banner. Once you click the map, the coordinates freeze so you can copy and paste the coordinates. That’s it!

A “Visual Refresh” for Google Maps


June 7th, 2013 | no comments    

How can developers take advantage of the new Google Maps that Google is now previewing? They have not announced a new API, but they do have a way you can make your maps look more like the future version.

With one line of code, programs that use the Google Maps API can swutch to a version that looks more modern:

google.maps.visualRefresh = true;

As explained in the Geo Developers Blog, the changes mostly involve new colors, a new shadowless default red pin and infobox, and minor changes to the controls. » Continue Reading…

A Better Way to Map Flickr Photos


March 7th, 2013 | no comments    

HeatmapperI’ve made a few different programs that display Flickr photos, but this is the best one yet. Give Heatmapper a try and see what you think.

The program searches only photos that have been geotagged. You control the boundaries of the search by moving the map before starting the search. You can pan and zoom the map, or just type a description of a place and use the built-in auto-complete geocoder.

You can narrow your search by matching for a word, or limiting the search to a specific user or group. If you leave both fields blank, you’ll see only photos added in the last 12 hours. » Continue Reading…

Mapping DC Bike Counts


February 21st, 2013 | 5 comments    

Bicycle Counts Stat MapperLast June, DDOT and MWCOG counted bicycle traffic over an 8-hour period in 48 locations. I got a copy of the results, and converted the spreadsheet into a map. The Bicycle Counts Stat Mapper uses the same interface I created for the Bicycle Accidents Stat Mapper, but with a few new features added.

A total of 21,930 cyclists were counted. They also recorded the rider’s sex, whether they were on a sidewalk, whether they were wearing a helmet, and whether they were riding a Capital Bikeshare bike: 75% were male, 27% were on a sidewalk, 69% wore helmets, 5% were on CaBi.

The place with the most bike traffic was the 15th St cycle track, measured north of P St. It got just under 200 cyclists per hour (198.8 to be exact). Its busiest hour saw 355 cyclists go through. » Continue Reading…

Mapping DC’s Bicycle Accidents


February 17th, 2013 | no comments    

statmapperWhen TheWashCycle blog reported on the Bicycle Crash Study 2010-2012, I was surprised to see the report didn’t include a map. So, I created a tool to view a map of the accident locations: the Stat Mapper.

I got a copy of the source data from DDOT. It covers January 6, 2010 to March 31, 2012. That period has 1,087 accidents in 744 locations. The report lists locations using text descriptions of the intersections. To convert into latitude & longitude coordinates for the map, I relied on Google’s geocoder. These results aren’t always accurate, especially if the text isn’t easily understood, like one accident that was recorded at “FBI:INTERSTATE 295″ (the geocoder placed that at the center of the city, but I manually moved it to 3rd & E NW).

By default the map shows a pin at every accident location. When you hover over a pin the header will show the total number of accidents there, as well as the total number of fatalities and injuries, and the number of vehicles and bicycles involved. You can click on the pin to get a full listing of all the accidents at that spot. The darker the pin, the more accidents at that location. The spot with the most accidents, nine, was at 14th & U NW. » Continue Reading…

Made-to-Order Mapmaking


February 4th, 2013 | no comments    

twomapsWhen you visualize geographic data, it helps to have a map for a background. To coordinate the map to your data, you need the latitudes and longitudes of the map’s boundaries. And to maximize the space, the map should be padded in only one direction, to make your boundaries fit the shape of the image. There are a few obstacles with getting the perfect map. To make it easier to find the perfect map, I’ve created a tool you can use to specify the perfect bounding box and image size.

I want to be able to specify two things:

  • The bounding box (north, south, east, west)
  • The image size (width and height, in pixels)

In addition to getting a map in return, I also need to know what the result’s bounding box is. It will probably be bigger than what I requested, unless the image size has the exact same ratio as my bounding box. That’s highly unlikely. To avoid stretching either the latitudes or longitudes, I need to add padding to either the left and right, or the top and bottom. Once the padding is added, the bounding box will grow either horizontally or vertically. » Continue Reading…

Saving Keystrokes with Places Autocomplete


January 31st, 2013 | no comments    

Places AutocompleteWhat’s cooler than using Google’s Geocoder to let users navigate using text descriptions? Replacing the geocoder entirely with Autocomplete.

The “Places Autocomplete” feature is one of the goodies you get when you import the Places Library. I decided to test it out on my WordWhere application. WordWhere lets users select a geographic area, then search a word to see where in the region it appears most frequently.

The program still geocodes the user’s input, but the code is simpler yet more powerful. The old geocoder object below get replaced… » Continue Reading…

Circle Selection for Google Maps


January 30th, 2013 | 1 comment    

selectionHow best to allow users to select multiple markers on a map? I wanted to let them draw a circle and have all markers within be selected. Using the Google Maps JavaScript API, I used the circle object for my solution.

I tested the circle selection in my Cabi Trip Visualizer. Clicking on an individual CaBi station draws arrows to all the other stations in its network. But the program becomes more interesting when you look at a network formed by multiple stations. I added some keyboard shortcuts to select clusters of my own design, such as G for Georgetown and V for Virginia. But those clusters were in arbitrary boundaries. I needed a way to let the user design their own clusters. » Continue Reading…

An Alternative to the InfoWindow


January 19th, 2013 | 1 comment    

I love minimal designs and try to create applications that make judicious use of the space they’re given on the user’s screen. For map apps, the Google Maps Javascript API includes “overlay” objects that you can anchor to the map, so that they move as expected when the user pans and zooms. The InfoWindow object is a pop-up box resembling a comic-book word balloon. Unfortunately, customization options are limited. I was frustrated by the fat margin around the content, and looked for other options.

The internet is flooded with other people looking for ways to customize the InfoWindow display. The best resource for add-ons that I found is the Google Maps Utility Library, an open-source collection of features that expand the Maps API. » Continue Reading…

Site by M.V. Jantzen
mvs202 "at" gmail.com
twitter.com/mvs202