Update map template variables specific to circle visual
558203
def add_unique_template_variables(self, options):
        """"""
        options.update(dict(
            geojson_data=json.dumps(self.data, ensure_ascii=False),
            colorProperty=self.color_property,
            colorType=self.color_function_type,
            colorStops=self.color_stops,
            strokeWidth=self.stroke_width,
            strokeColor=self.stroke_color,
            radius=self.radius,
            defaultColor=self.color_default,
            highlightColor=self.highlight_color
        ))

        if self.vector_source:
            options.update(vectorColorStops=self.generate_vector_color_map())
1038846
public void setCircleTranslate( Float[] value) {
    PropertyValue propertyValue = circleTranslate(value);
    constantPropertyUsageMap.put(PROPERTY_CIRCLE_TRANSLATE, propertyValue);
    layer.setProperties(propertyValue);
  }
363678
private void updateMappingsWithLocalReferences(MtasParserObject currentObject,
      Map<String, List<MtasParserObject>> currentList,
      Map<String, Map<Integer, Set<String>>> updateList) {
    if (currentObject.getType().type.equals(MAPPING_TYPE_GROUP)) {
      for (Integer tokenId : updateList
          .get(UPDATE_TYPE_LOCAL_REF_POSITION_START).keySet()) {
        if (updateList.get(UPDATE_TYPE_LOCAL_REF_POSITION_END)
            .containsKey(tokenId)
            && updateList.get(UPDATE_TYPE_LOCAL_REF_OFFSET_START)
                .containsKey(tokenId)
            && updateList.get(UPDATE_TYPE_LOCAL_REF_OFFSET_END)
                .containsKey(tokenId)) {
          Iterator<String> startPositionIt = updateList
              .get(UPDATE_TYPE_LOCAL_REF_POSITION_START).get(tokenId)
              .iterator();
          Iterator<String> endPositionIt = updateList
              .get(UPDATE_TYPE_LOCAL_REF_POSITION_END).get(tokenId).iterator();
          Iterator<String> startOffsetIt = updateList
              .get(UPDATE_TYPE_LOCAL_REF_OFFSET_START).get(tokenId).iterator();
          Iterator<String> endOffsetIt = updateList
              .get(UPDATE_TYPE_LOCAL_REF_OFFSET_END).get(tokenId).iterator();
          Integer startPosition = null;
          Integer endPosition = null;
          Integer startOffset = null;
          Integer endOffset = null;
          Integer newValue = null;
          while (startPositionIt.hasNext()) {
            String localKey = startPositionIt.next();
            if (currentObject.referredStartPosition.containsKey(localKey)) {
              newValue = currentObject.referredStartPosition.get(localKey);
              startPosition = (startPosition == null) ? newValue
                  : Math.min(startPosition, newValue);
            }
          }
          while (endPositionIt.hasNext()) {
            String localKey = endPositionIt.next();
            if (currentObject.referredEndPosition.containsKey(localKey)) {
              newValue = currentObject.referredEndPosition.get(localKey);
              endPosition = (endPosition == null) ? newValue
                  : Math.max(endPosition, newValue);
            }
          }
          while (startOffsetIt.hasNext()) {
            String localKey = startOffsetIt.next();
            if (currentObject.referredStartOffset.containsKey(localKey)) {
              newValue = currentObject.referredStartOffset.get(localKey);
              startOffset = (startOffset == null) ? newValue
                  : Math.min(startOffset, newValue);
            }
          }
          while (endOffsetIt.hasNext()) {
            String localKey = endOffsetIt.next();
            if (currentObject.referredEndOffset.containsKey(localKey)) {
              newValue = currentObject.referredEndOffset.get(localKey);
              endOffset = (endOffset == null) ? newValue
                  : Math.max(endOffset, newValue);
            }
          }
          if (startPosition != null && endPosition != null
              && startOffset != null && endOffset != null) {
            MtasToken token = tokenCollection.get(tokenId);
            token.addPositionRange(startPosition, endPosition);
            token.setOffset(startOffset, endOffset);
          }
        }
      }

    }
    if (!currentList.get(MAPPING_TYPE_GROUP).isEmpty()) {
      MtasParserObject parentGroup = currentList.get(MAPPING_TYPE_GROUP)
          .get(currentList.get(MAPPING_TYPE_GROUP).size() - 1);
      parentGroup.referredStartPosition
          .putAll(currentObject.referredStartPosition);
      parentGroup.referredEndPosition.putAll(currentObject.referredEndPosition);
      parentGroup.referredStartOffset.putAll(currentObject.referredStartOffset);
      parentGroup.referredEndOffset.putAll(currentObject.referredEndOffset);
    }
    currentObject.referredStartPosition.clear();
    currentObject.referredEndPosition.clear();
    currentObject.referredStartOffset.clear();
    currentObject.referredEndOffset.clear();
  }
271279
function setMapLoc(lib, opts, map) {
  let oldZoom;
  let view;
  switch (lib) {
    case 'leaflet':
      map.panTo([opts.lat,opts.lon]);
      if (opts.zoom){map.setZoom(opts.zoom)}
      break;
    case 'googlemaps':
      map.setCenter({lat: opts.lat,lng:opts.lon});
      if (opts.zoom) {map.setZoom(opts.zoom)}
      break;
    case 'openlayers':
      oldZoom = map.getView().getZoom();
      view = new ol.View({
          center: ol.proj.fromLonLat([opts.lon,opts.lat]),
          zoom: opts.zoom? opts.zoom: oldZoom
        });
      map.setView(view);
    }
}
1214949
function mapMapNode(node, parent, maps, id)
  {
    var local,
        attrs = __slice.call(node.attributes),
        nodeMaps = [],
        nodeId = uuid(),
        item,
        x = 0,
        len = attrs.length,
        text,
        title,
        mapText,
        i,
        lenn;
      
    for(x;x<len;x++)
    {
      text = attrs[x].value;
      title = attrs[x].name;
      if(title === '__kaleonodebind__')
      {
        mapText = splitText(text);
        item = mapText[0];

        /* create nodemap */
        local = new mapObject({
          local_id: id,
          node_id: nodeId,
          mapIndex: maps.length,
          mapTextIndex: 0,
          text: item,
          mapText: mapText,
          maps: maps,
          type: 'node',
          property: 'nodeName',
          listener: 'nodeName',
          isDirty: false,
          localAttr: 'nodeName',
          node: node,
          values: nodeMaps
        })
        maps.push(local);
        mapText[0] = maps[(maps.length - 1)];
      }
      else if(title === '__kaleoattrsbind__')
      {
        mapAttrName(node, text, nodeMaps, id, nodeId, true);
      }
      else if(title === '__kaleostylebind__')
      {
        mapStyleAttr(node, text, nodeMaps, id, nodeId, true);
      }
      else if(text.match(__matchText))
      {
        mapText = splitText(text);
        lenn = mapText.length;
        i = 0;
        for(i;i<lenn;i++)
        {
          item = mapText[i];
          if(item.match(__matchInsert))
          {
            nodeMaps.push(new mapObject({
              local_id: id,
              node_id: nodeId,
              mapIndex: maps.length,
              mapTextIndex: i,
              text: item,
              mapText: mapText,
              maps: nodeMaps,
              type: 'pointer',
              isInsert: true,
              property: title,
              local: attrs[x],
              localAttr: 'value',
              node: node,
              isAttr: true
            }));
          }
          else if(item.match(__matchText))
          {
            nodeMaps.push(new mapObject({
              local_id: id,
              node_id: nodeId,
              mapIndex: maps.length,
              mapTextIndex: i,
              text: item,
              mapText: mapText,
              maps: nodeMaps,
              type: 'pointer',
              property: title,
              listener: title,
              local: attrs[x],
              localAttr: 'value',
              node: node,
              isAttr: true,
              isPointer: true
            }));
          }
        }
      }
    }
  }
454671
public function render(Circle $circle, Map $map)
    {
        $formatter = $this->getFormatter();
        $jsonBuilder = $this->getJsonBuilder()
            ->setValue('[map]', $map->getVariable(), false)
            ->setValue('[center]', $circle->getCenter()->getVariable(), false)
            ->setValue('[radius]', $circle->getRadius())
            ->setValues($circle->getOptions());

        return $formatter->renderObjectAssignment($circle, $formatter->renderObject('Circle', [
            $jsonBuilder->build(),
        ]));
    }
523937
void updateRadius() {
		if (isPressed() && currentShadowRadius < getMaxShadowRadius()) {
			currentShadowRadius += SHADOW_DRAWING_STEP;
			getActionButton().getInvalidator().requireInvalidation();
		} else if (!isPressed() && currentShadowRadius > getMinShadowRadius()) {
			currentShadowRadius -= SHADOW_DRAWING_STEP;
			getActionButton().getInvalidator().requireInvalidation();
		} else if (!isPressed()){
			currentShadowRadius = getActionButton().getShadowRadius();
		}
		LOGGER.trace("Updated Shadow Responsive Effect current radius to: {}", currentShadowRadius);
	}
1090570
def add_unique_template_variables(self, options):
        """"""
        options.update(dict(
            image=self.image,
            coordinates=self.coordinates))
663277
def update_frame(self, key, ranges=None, plot=None, element=None):
        
        reused = isinstance(self.hmap, DynamicMap) and (self.overlaid or self.batched)
        if not reused and element is None:
            element = self._get_frame(key)
        elif element is not None:
            self.current_key = key
            self.current_frame = element

        renderer = self.handles.get('glyph_renderer', None)
        glyph = self.handles.get('glyph', None)
        visible = element is not None
        if hasattr(renderer, 'visible'):
            renderer.visible = visible
        if hasattr(glyph, 'visible'):
            glyph.visible = visible

        if ((self.batched and not element) or element is None or (not self.dynamic and self.static) or
            (self.streaming and self.streaming[0].data is self.current_frame.data and not self.streaming[0]._triggering)):
            return

        if self.batched:
            style_element = element.last
            max_cycles = None
        else:
            style_element = element
            max_cycles = self.style._max_cycles
        style = self.lookup_options(style_element, 'style')
        self.style = style.max_cycles(max_cycles) if max_cycles else style

        ranges = self.compute_ranges(self.hmap, key, ranges)
        self.param.set_param(**self.lookup_options(style_element, 'plot').options)
        ranges = util.match_spec(style_element, ranges)
        self.current_ranges = ranges
        plot = self.handles['plot']
        if not self.overlaid:
            self._update_ranges(style_element, ranges)
            self._update_plot(key, plot, style_element)
            self._set_active_tools(plot)

        if 'hover' in self.handles and 'hv_created' in self.handles['hover'].tags:
            self._update_hover(element)

        self._update_glyphs(element, ranges, self.style[self.cyclic_index])
        self._execute_hooks(element)
1149644
function (legend, item) {
		var radius = pInt(legend.itemStyle.fontSize) / 2;
		
		item.legendSymbol = this.chart.renderer.circle(
			radius,
			legend.baseline - radius,
			radius
		).attr({
			zIndex: 3
		}).add(item.legendGroup);
		item.legendSymbol.isMarker = true;	
		
	}
714519
def get_map_template(layers, has_zoom):
    """"""
    num_layers = len(non_basemap_layers(layers))
    has_time = has_time_layer(layers)
    name = get_map_name(layers, has_zoom=has_zoom)

    # Add basemap layer
    layers_field = [{
        'type': 'http',
        'options': {
            # TODO: Remove this once baselayer urls can be passed in named map
            #       config
            'urlTemplate': layers[0].url,
            # 'urlTemplate': '<%= basemap_url %>',
            'subdomains': "abcd",
        },
    }]

    # [BUG] Remove this once baselayer urls can be passed in named map config
    placeholders = {}
    # placeholders = {
    #     'basemap_url': {
    #         'type': 'sql_ident',
    #         'default': ('https://cartodb-basemaps-{s}.global.ssl.fastly.net/'
    #                     'dark_all/{z}/{x}/{y}.png'),
    #     },
    # }

    for idx in range(num_layers):
        layers_field.extend([{
            'type': ('torque' if (has_time and idx == (num_layers - 1))
                     else 'mapnik'),
            'options': {
                'cartocss_version': '2.1.1',
                'cartocss': '<%= cartocss_{idx} %>'.format(idx=idx),
                'sql': '<%= sql_{idx} %>'.format(idx=idx),
                # [BUG] No [] for templating
                # 'interactivity': '<%= interactivity_{idx} %>'.format(
                #                                                 idx=idx),
            }
        }])
        placeholders.update({
            'cartocss_{idx}'.format(idx=idx): {
                'type': 'sql_ident',
                'default': ('#layer {'
                            ' marker-fill: red;'
                            ' marker-width: 5;'
                            ' marker-allow-overlap: true;'
                            ' marker-line-color: #000; }'),
            },
            'sql_{idx}'.format(idx=idx): {
                'type': 'sql_ident',
                'default': (
                        "SELECT "
                        "ST_PointFromText('POINT(0 0)', 4326) AS the_geom, "
                        "1 AS cartodb_id, "
                        "ST_PointFromText('Point(0 0)', 3857) AS "
                        "the_geom_webmercator"
                    ),
            },
            # [BUG] No [] for templating
            # 'interactivity_{idx}'.format(idx=idx): {
            #     'type': 'sql_ident',
            #     'default': '["cartodb_id"]',
            # },
        })

    # Add labels if they're in front
    if num_layers > 0 and layers[-1].is_basemap:
        layers_field.extend([{
            'type': 'http',
            'options': {
                # TODO: Remove this once baselayer urls can be passed in named
                #       map config
                'urlTemplate': layers[-1].url,
                # 'urlTemplate': '<%= basemap_url %>',
                'subdomains': "abcd",
            },
        }])

    if has_zoom:
        view = {
            'zoom': '<%= zoom %>',
            'center': {
                'lng': '<%= lng %>',
                'lat': '<%= lat %>',
            },
        }
        placeholders.update({
            'zoom': {
                'type': 'number',
                'default': 3,
            },
            'lng': {
                'type': 'number',
                'default': 0,
            },
            'lat': {
                'type': 'number',
                'default': 0,
            },
        })
    else:
        view = {
            'bounds': {
                'west': '<%= west %>',
                'south': '<%= south %>',
                'east': '<%= east %>',
                'north': '<%= north %>',
            },
        }
        placeholders.update({
            'west': {
                'type': 'number',
                'default': -45,
            },
            'south': {
                'type': 'number',
                'default': -45,
            },
            'east': {
                'type': 'number',
                'default':  45,
            },
            'north': {
                'type': 'number',
                'default':  45,
            },
        })

    return json.dumps({
        'version': '0.0.1',
        'name': name,
        'placeholders': placeholders,
        'layergroup': {
            'version': '1.0.1',
            'layers': layers_field,
        },
        'view': view,
    })
584699
def substitute(script, submap):

    """"""

    match = config.TEMPLATE_RE.search(script)
    if match:
        template_type = match.groupdict()['type']
        try:
            return config.TEMPLATE_TYPEMAP[template_type](script, submap)
        except KeyError:
            logger.error('Unsupported template type: %s' % template_type)
            raise
    return script
174809
def add_unique_template_variables(self, options):
        """"""
        options.update(dict(
            colorStops=self.color_stops,
            colorDefault=self.color_default,
            radiusStops=self.radius_stops,
            clusterRadius=self.clusterRadius,
            clusterMaxZoom=self.clusterMaxZoom,
            strokeWidth=self.stroke_width,
            strokeColor=self.stroke_color,
            radiusDefault=self.radius_default,
            highlightColor=self.highlight_color
        ))
21118
function(map) {
        OpenLayers.Control.PanZoom.prototype.setMap.apply(this, arguments);
        this.map.events.on({
            "changebaselayer": this.redraw,
            "updatesize": this.redraw,
            scope: this
        });
    }
900207
function(node, circle, settings) {
      var prefix = settings('prefix') || '';

      // Applying changes
      // TODO: optimize - check if necessary
      circle.setAttributeNS(null, 'cx', node[prefix + 'x']);
      circle.setAttributeNS(null, 'cy', node[prefix + 'y']);
      circle.setAttributeNS(null, 'r', node[prefix + 'size']);

      // Updating only if not freestyle
      if (!settings('freeStyle'))
        circle.setAttributeNS(
          null, 'fill', node.color || settings('defaultNodeColor'));

      // Showing
      circle.style.display = '';

      return this;
    }
194532
function() {
    var polygon = this._shape;
    for (var i = 0, len = polygon._latlngs.length; i < len; i++) {
      // update marker
      var marker = this._resizeMarkers[i];
      marker.setLatLng(polygon._latlngs[i]);

      // this one's needed to update the path
      marker._origLatLng = polygon._latlngs[i];
      if (marker._middleLeft) {
        marker._middleLeft.setLatLng(this._getMiddleLatLng(marker._prev, marker));
      }
      if (marker._middleRight) {
        marker._middleRight.setLatLng(this._getMiddleLatLng(marker, marker._next));
      }
    }
    // this._moveMarker.setLatLng(polygon.getBounds().getCenter());

    // show vertices
    this._shape._map.addLayer(this._markerGroup);
    this._updateMoveMarker();

    this._repositionCornerMarkers();
    this._fireEdit();
  }
424089
function (key, value) {
        // FIXME
        if (key === 'shape') {
            this.setShape(value);
            this.__dirtyPath = true;
            this._rect = null;
        }
        else {
            Displayable.prototype.attrKV.call(this, key, value);
        }
    }