Skip to content

Instantly share code, notes, and snippets.

@asizer
asizer / index.html
Created February 24, 2015 22:29
Broken BMG with basemap labels
<!DOCTYPE html>
<html>
<head>
<title>Broken Basemap Gallery</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no,width=device-width" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<link rel="stylesheet" href="//js.arcgis.com/3.12/esri/css/esri.css">
@asizer
asizer / index.html
Created February 24, 2015 22:08
Remove webmap basemap
<!DOCTYPE html>
<html>
<head>
<title>Webmap Basemaps</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no,width=device-width" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<link rel="stylesheet" href="//js.arcgis.com/3.12/esri/css/esri.css">
@asizer
asizer / index.html
Created February 24, 2015 22:06
Fixing BMG and original basemaps with labels
<!DOCTYPE html>
<html>
<head>
<title>Fixing Basemap Gallery</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no,width=device-width" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<link rel="stylesheet" href="//js.arcgis.com/3.12/esri/css/esri.css">
@asizer
asizer / Gruntfile.js
Last active February 11, 2024 23:13
Grunt tasks for concatenating and minifying AMD modules and templates
/*global module:false*/
module.exports = function(grunt) {
// Load grunt tasks automatically
require('load-grunt-tasks')(grunt);
// Project configuration.
grunt.initConfig({
// use esri_slurp to download api locally. This allows a custom build of the
@asizer
asizer / partialGruntfile.js
Last active August 29, 2015 14:12
Use grunt concat to create single file for dojo modules AND TEMPLATES!
concat: {
options: {
banner: 'require({\ncache: {\n',
process: function(src, filepath) {
var returnStr = '// Source: ' + filepath + '\n';
if (filepath.indexOf('.js') > 0) {
// add file name
returnStr += '\'' + filepath.replace('js/', '').replace('.js', '') + '\': ';
// add function and file text
returnStr += 'function() {\n' + src + '}';
@asizer
asizer / index.html
Created November 7, 2014 01:13
Colors for labels
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Feature Layer Multi-Line Labels</title>
<link rel="stylesheet" href="//js.arcgis.com/3.10/js/esri/css/esri.css">
<style>
html, body, #map {
height: 100%; width: 100%; margin: 0; padding: 0;
@asizer
asizer / README.md
Created October 28, 2014 15:46
Feature Layer with Multi-Line Labels

Multi-line labels on a Feature Layer

This is a workaround to add line breaks to the Label Layer

NOTE: I can't figure out a way to return all the labels for a Feature Layer here, unfortunately. The Label Layer only returns the labels that will fit into their elements, or not conflict with other labels, as calculated based on the original, single-line label. Splitting these labels into multiple lines might reduce conflicts, or allow them to fit properly within their polygons, but because they were conflicted out in the first place, we never see them.

@asizer
asizer / index.html
Created September 11, 2014 03:13
LabelClass on DynamicLayer
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title></title>
<link rel="stylesheet" href="//js.arcgis.com/3.10/js/esri/css/esri.css">
<style>
html, body, #map {
height: 100%; width: 100%; margin: 0; padding: 0;
@asizer
asizer / README.md
Last active August 29, 2015 14:04 — forked from mbostock/.block
@asizer
asizer / Widget.js
Created July 11, 2014 22:25
Make dojo xhrRequest work with secured service
/* all this is around line 334 of SQLQuery/Widget.js */
// option 1 is to query the rest endpoint for unique values.
// option 2 is to store featureSet clientside (1000 limit)
var tokenRequest = esri.id.findCredential(this.activeInfo.fLayerUrl); // THIS IS NEW!
if (!this.activeInfo.featureSet) {
dojoXhr(this.activeInfo.fLayerUrl + '/query', {
query: {
where: '1=1',
outFields: fieldInfo.name,