annotate hexagram-6ae12361157c/hexagram/maplabel-compiled.js @ 0:1407e3634bcf draft default tip

Uploaded r11 from test tool shed.
author adam-novak
date Tue, 22 Oct 2013 14:17:59 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
1407e3634bcf Uploaded r11 from test tool shed.
adam-novak
parents:
diff changeset
1 (function(){/*
1407e3634bcf Uploaded r11 from test tool shed.
adam-novak
parents:
diff changeset
2
1407e3634bcf Uploaded r11 from test tool shed.
adam-novak
parents:
diff changeset
3
1407e3634bcf Uploaded r11 from test tool shed.
adam-novak
parents:
diff changeset
4 Copyright 2011 Google Inc.
1407e3634bcf Uploaded r11 from test tool shed.
adam-novak
parents:
diff changeset
5
1407e3634bcf Uploaded r11 from test tool shed.
adam-novak
parents:
diff changeset
6 Licensed under the Apache License, Version 2.0 (the "License");
1407e3634bcf Uploaded r11 from test tool shed.
adam-novak
parents:
diff changeset
7 you may not use this file except in compliance with the License.
1407e3634bcf Uploaded r11 from test tool shed.
adam-novak
parents:
diff changeset
8 You may obtain a copy of the License at
1407e3634bcf Uploaded r11 from test tool shed.
adam-novak
parents:
diff changeset
9
1407e3634bcf Uploaded r11 from test tool shed.
adam-novak
parents:
diff changeset
10 http://www.apache.org/licenses/LICENSE-2.0
1407e3634bcf Uploaded r11 from test tool shed.
adam-novak
parents:
diff changeset
11
1407e3634bcf Uploaded r11 from test tool shed.
adam-novak
parents:
diff changeset
12 Unless required by applicable law or agreed to in writing, software
1407e3634bcf Uploaded r11 from test tool shed.
adam-novak
parents:
diff changeset
13 distributed under the License is distributed on an "AS IS" BASIS,
1407e3634bcf Uploaded r11 from test tool shed.
adam-novak
parents:
diff changeset
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1407e3634bcf Uploaded r11 from test tool shed.
adam-novak
parents:
diff changeset
15 See the License for the specific language governing permissions and
1407e3634bcf Uploaded r11 from test tool shed.
adam-novak
parents:
diff changeset
16 limitations under the License.
1407e3634bcf Uploaded r11 from test tool shed.
adam-novak
parents:
diff changeset
17 */
1407e3634bcf Uploaded r11 from test tool shed.
adam-novak
parents:
diff changeset
18 var d="prototype";function e(a){this.set("fontFamily","sans-serif");this.set("fontSize",12);this.set("fontColor","#000000");this.set("strokeWeight",4);this.set("strokeColor","#ffffff");this.set("align","center");this.set("zIndex",1E3);this.setValues(a)}e.prototype=new google.maps.OverlayView;window.MapLabel=e;e[d].changed=function(a){switch(a){case "fontFamily":case "fontSize":case "fontColor":case "strokeWeight":case "strokeColor":case "align":case "text":return h(this);case "maxZoom":case "minZoom":case "position":return this.draw()}};
1407e3634bcf Uploaded r11 from test tool shed.
adam-novak
parents:
diff changeset
19 function h(a){var b=a.a;if(b){var f=b.style;f.zIndex=a.get("zIndex");var c=b.getContext("2d");c.clearRect(0,0,b.width,b.height);c.strokeStyle=a.get("strokeColor");c.fillStyle=a.get("fontColor");c.font=a.get("fontSize")+"px "+a.get("fontFamily");var b=Number(a.get("strokeWeight")),g=a.get("text");if(g){if(b)c.lineWidth=b,c.strokeText(g,b,b);c.fillText(g,b,b);a:{c=c.measureText(g).width+b;switch(a.get("align")){case "left":a=0;break a;case "right":a=-c;break a}a=c/-2}f.marginLeft=a+"px";f.marginTop=
1407e3634bcf Uploaded r11 from test tool shed.
adam-novak
parents:
diff changeset
20 "-0.4em"}}}e[d].onAdd=function(){var a=this.a=document.createElement("canvas");a.style.position="absolute";var b=a.getContext("2d");b.lineJoin="round";b.textBaseline="top";h(this);(b=this.getPanes())&&b.mapPane.appendChild(a)};e[d].onAdd=e[d].onAdd;
1407e3634bcf Uploaded r11 from test tool shed.
adam-novak
parents:
diff changeset
21 e[d].draw=function(){var a=this.getProjection();if(a&&this.a){var b=this.get("position");if(b){b=a.fromLatLngToDivPixel(b);a=this.a.style;a.top=b.y+"px";a.left=b.x+"px";var b=this.get("minZoom"),f=this.get("maxZoom");if(b===void 0&&f===void 0)b="";else{var c=this.getMap();c?(c=c.getZoom(),b=c<b||c>f?"hidden":""):b=""}a.visibility=b}}};e[d].draw=e[d].draw;e[d].onRemove=function(){var a=this.a;a&&a.parentNode&&a.parentNode.removeChild(a)};e[d].onRemove=e[d].onRemove;})()