BearPanther.com

BearPanther.com

Making the web a better place


Featured

Blog

There are many d3 demos like this but this one is mine

Posted on June 8th, 2014.

I’ve tinkered with d3 off and on for a while and it’s almost always refreshing and satisfying. So much of the usual heavy lifting of visualizing some dataset is done for you (when you know where to look). Scales are helpful, transitions are fantastic and building a chunk of DOM from a dataset is relatively […]

Featured

Blog

CSS font property shorthand does what?

Posted on June 3rd, 2014.

Here’s some CSS: font: bold 18px 'Lucida Console',Monaco,monospace !important; Besides the !important, see any warts? Me neither, at least at first. (And I’m not talking about using pixels as units. I don’t want to go there.) I didn’t know this, but the shorthand for font in CSS includes line-height as well as all the font-* […]

Featured

Blog

A simple photo gallery

Posted on December 16th, 2013.

I recently did some traveling and, yada yada yada, I ended up with a bunch of photos I wanted to share. I’m not a photographer and have never been a big user of any of the major photo hosting/sharing sites like flickr or smugmug. So I put together a simple photo gallery: http://rawr.gr/kenya. While brainstorming […]

Featured

Blog

Searching files and deleting a line that contains some term

Posted on November 18th, 2013.

How would you delete a line from one or more of hundreds of files in a tree of directories when a line contains a specific term? When this was put in front of me, I thought, “np, sublime can probably handle this”. As great as our text editors are, I don’t think this is a […]

Featured

Blog

Everyone’s tiles

Posted on November 11th, 2013.

I’m calling this a map quilt: http://bearpanther.com/quilt/. The idea is to take tile server endpoints for several different tile sets and use them all in a single tiled layer. This was more of a “I wonder if…” idea that I took too far. Under the hood there’s a custom class that subclasses esri/layers/TiledMapServiceLayer so at […]

Featured

Blog

Client side geodesic buffers

Posted on November 4th, 2013.

Far and away, the most common type of spatial data on the web is point data. Do I have anything to back that up? No. But I don’t think many would argue. And when we have point data, we usually want to know about things that are within a certain distance. Tobler! In GIS-speak, this […]

Featured

Blog

Abusing hue-rotate with NodeList

Posted on October 28th, 2013.

There’s a cool demo out there from Rene Rubalcava called MapTileSytler (source on github). The CSS used there only works in webkit browsers but it’s cool nonetheless. After playing around, I put together a terrible example of what you can do with some of this stuff: check it out. Click the map to make it […]

Featured

Blog

Esri JavaScript map center, zoom level and extent

Posted on October 21st, 2013.

Several times a day, I need to find one or more of the following from a map on a web page using the Esri JavaScript API: map center map zoom level map extent AKA bounding box Most of the time, I want this info because I need it for a map I’m putting in something […]

Featured

Blog

Converting XML to CSV with Python

Posted on September 14th, 2013.

XML. The word “yay” doesn’t necessarily spring to mind. I recently found myself staring at a URL that returned a bunch of XML. It crossed my mind to stop there, but I really wanted this data so I pressed on. Luckily, like so many things, Python, by way of the lxml toolkit, makes dealing with […]

Featured

Blog

Sublime Text’s Search and Replace with Regular Expressions

Posted on September 12th, 2013.

I know I’m not alone when I say I like code formatted a particular way. And that I spend more time that I’d care to admit converting tabs to spaces, indenting, un-indenting and so on. Lately I’ve been using Sublime Text 2′s find and replace with regular expressions to speed up getting code looking just […]

Featured

Blog

GoToRepo Bookmarklet

Posted on June 23rd, 2013.

Earlier this week I was looking at something on github.io and wanted to see the associated repository. There wasn’t a link on the page so I started to do the github-pages-to-repo-shuffle. That is: change .io to .com move subdomain (github user name) after .com/ trim everything after the repo name While tweaking the URL, I […]

Featured

Blog

Easy Text Selection in Mobile Safari

Posted on May 27th, 2013.

Selecting text in Mobile Safari is not as easy as it could/should be. This is one of those things that is strangely hard compared to what we’re used to with a mouse. What’s the solution? JavaScript, of course. Before getting into the specifics, here’s a simple demo to show where this post is going. Some […]

Featured

ArcGIS Online

Simple editing using an ArcGIS Online web map

Posted on April 8th, 2013.

This post will describe simple editing using the Esri JavaScript API and an ArcGIS Online web map. sourcecode view it live There are plenty of samples  covering how to edit using the Esri JavaScript API. Where I find the documentation runs short is using the samples with a web map authored in ArcGIS Online. Lucky for […]

Featured

Blog

Simple StateFace Stuff

Posted on March 3rd, 2013.

After playing around with Stately yesterday, I remembered another icon font I told myself I’d play around with: StateFace. StateFace doesn’t let you make maps of the US the way Stately does, but rather lets you easily embed state shapes in your content. To get a feel for how it works, I put together a […]

Featured

Blog

Messin’ with Stately

Posted on March 2nd, 2013.

Stately has been making the rounds and I decided to play around with it. The idea of making a with nothing more than some html and css is pretty cool. It’s also a huge departure from how I would usually make a map for the web. First up, I wanted to do something similar to […]

Featured

Blog

Alphabetize Fitocracy Activities

Posted on September 28th, 2012.

Any Fitocracy users out there? I started using it earlier this year and it’s become my go to place to track my workouts. One thing that irks me about the site is that activities in the performance section are sorted by the number of times you’ve done an activity. Because activities in the list have […]

Featured

Blog

A Simple Way to Display Feature Info

Posted on September 27th, 2012.

We’re always looking for ways to streamline and simplify how information from a map is displayed. To that end, I threw together a simple class to make displaying info from features on a map simpler. For now, I’m calling it a “tip”. Here’s a demo showing feature info as features are moused-over. I also set […]

Featured

Blog

Crossfit Regions – ArcGIS web map style.

Posted on April 11th, 2012.

CrossFit Regions - On an ArcGIS online map. This was an excuse to try out a lot of different things. Most notably an excuse to use an ArcGIS.com web map in a “real” application. Esri has the basic viewer with a lot of sample code on how to hook into the map but reading and doing are […]

Featured

Blog

Gzip JSON Generated On the Fly

Posted on April 11th, 2012.

We love JSON. It’s simple, human-readable AND browsers love it. My only complaint is that it’s not as efficient as it could be when sending data to a client. Normally, this isn’t an issue. But when you start working with mobile-specific web apps, every byte counts. Since we’ve been working on something that is mobile […]

Featured

Blog

Create a Feature Layer from JSON

Posted on March 15th, 2012.

One of my favorite features of the feature layer is that you can create one from a feature collection. There’s a sample showing how to do this. I don’t know if many people realize you can do this…so that’s one of the reasons I’ve decided to blog about it. An example I published for the […]

Featured

Blog

Picture Marker Symbols from Base64 Strings

Posted on March 12th, 2012.

The ArcGIS blog featured a post with a picture marker symbol generator a while back (full disclosure: written by a teammate of mine, Kelly Hutchins). The general focus of the post was how to use symbols from ArcGIS.com in your own apps. As an added bonus, there is an option to generate base64 strings for […]

Featured

Blog

Close a Map’s Info Window with the Escape Key

Posted on March 12th, 2012.

One thing I find myself including in more and more apps is the ability to close a map‘s info window when the escape key is pressed. I included this in instamap as well as the MLB layer examples (web mercator and albers). The code to make this happen is straight forward: dojo.connect(map, "onKeyDown", function (evt){ […]

Featured

Blog

Add button to Esri’s default editing widget

Posted on March 8th, 2012.

This is a very quick post on adding a button to the default editor widget. This is straightforward after you know what you are looking for. AKA use firebug or chrome dev tools. There will not be a bunch of code and technically the button will not do anything but the idea is is to […]

Featured

Blog

Extend the esri JavaScript BasicViewer

Posted on March 8th, 2012.

Esri was kind enough to put out the BasicViewer for working with ArcGIS online web application. Although this may or not be designed as a starting point for developers it might be a time saver depending on your project. I believe the true intention was that it is just another view for your online application. […]

Featured

baseball

MLB teams on a map? No problem.

Posted on March 4th, 2012.

Spring training is officially underway. To celebrate, I decided to put together a custom layer (subclass of esri.layers.GraphicsLayer) to show Major League Baseball team logos on a map. Of course, I’m using the ArcGIS API for JavaScript. Check out two demos I put together using the new layer: MLB Layer on standard basemaps MLB Layer […]

Featured

Blog

Instamap source available on github

Posted on February 9th, 2012.

Here we are, the fifth and final post on instamap. And this one is going to be short and sweet. The code and files for instamap are now available on github: instamap. What does that mean? Well, if you want a copy of instamap, and you have git installed, all you need to do is: […]

Featured

Blog

Horizontal scrolling of a dijit.layout.ContentPane

Posted on February 7th, 2012.

Welcome to part four of a five part series on bearpanther’s instamap. On the agenda today: horizontal scrolling of content in a dijit content pane. “WTF?”, you might be saying to yourself. Well, to put it another way, this post will talk about the ins and outs that make up the horizontally scrolling footer that […]

Featured

Blog

Using JSONP APIs

Posted on February 3rd, 2012.

Everybody loves JSON. (No, I don’t have any links to back that up.) And for good reason– browsers are fluent in it, it’s easy to generate, easy to parse and lightweight enough to make it the ideal way to communicate with web services. JSONP (the P is for padding) is a well known technique to […]

Featured

Blog

Building a simple basemap switcher

Posted on February 1st, 2012.

The ArcGIS API for JavaScript includes a basemap gallery widget. So why have I titled this post “Building a simple basemap switcher”? As great as the basemap gallery widget is, I wanted something a bit lighter for my instagram app. The idea is a well-established one:  provide a simple UI for toggling basemap layers. I […]

Featured

Blog

Using dojo classes

Posted on January 30th, 2012.

This is part one in a … five? Let’s go with five. Five-part series wherein I talk about how I built a simple app that uses the Instagram API. In this post, I’m going to focus on the classes I used to build the app. There are only two:  bearpanther.InstagramSearch and bearpanther.BingGeocode. Hopefully the name […]

Featured

Blog

Putting Instagram on a map

Posted on January 26th, 2012.

You know Instragram, right? Not only is the app fantastic, but they also have a pretty kick-ass API. It’s read-only but that’s all you need to start building an app with it. I spent a little time this past weekend putting together a simple single-page web app to display photos from Instagram based on a […]

Featured

Blog

Flexviewer clustering add popup windows

Posted on January 18th, 2012.

Esri has a very nice example of feature layer clustering  in the API samples. In the newest flexviewers they have included the ability to add clusters out of the box. Great! The only real limitation is that out of the box there is no ability to use popups on the flare elements. In this post […]