/**
     * @see MapsLayer::getJavaScriptDefinition
     * 
     * @since 0.7.2
     * 
     * @return string
     */
    public function getJavaScriptDefinition()
    {
        foreach ($this->properties as $name => $value) {
            ${$name} = MapsMapper::encodeJsVar($value);
        }
        $options = array('extractStyles' => true, 'extractAttributes' => true, 'maxDepth' => $maxdepth);
        $options = Xml::encodeJsVar((object) $options);
        return <<<EOT
\tnew OpenLayers.Layer.GML(
\t\t{$label},
\t\t{$source},
\t\t{
\t\t\tformat: OpenLayers.Format.KML, 
\t\t\tformatOptions: {$options}
\t\t}
\t)
EOT;
    }
Exemplo n.º 2
0
    /**
     * @see MapsLayer::getJavaScriptDefinition
     * 
     * @since 0.7.2
     * 
     * @return string
     */
    public function getJavaScriptDefinition()
    {
        foreach ($this->properties as $name => $value) {
            ${$name} = MapsMapper::encodeJsVar($value);
        }
        $options = array('isImage' => true);
        if ($zoomlevels !== false) {
            $options['numZoomLevels'] = $zoomlevels;
        }
        $options = Xml::encodeJsVar((object) $options);
        return <<<EOT
\tnew OpenLayers.Layer.Image(
\t\t{$label},
\t\t{$source},
\t\tnew OpenLayers.Bounds({$leftbound}, {$lowerbound}, {$rightbound}, {$upperbound}),
\t\tnew OpenLayers.Size({$width}, {$height}),
\t\t{$options}
\t)
EOT;
    }
Exemplo n.º 3
0
    /**
     * @see MapsLayer::getJavaScriptDefinition
     * 
     * @since 0.7.2
     * 
     * @return string
     */
    public function getJavaScriptDefinition()
    {
        $this->validate();
        // do image layer options:
        $options = array('isImage' => true, 'units' => $this->properties['units']);
        if ($this->properties['zoomlevels'] !== false) {
            $options['numZoomLevels'] = $this->properties['zoomlevels'];
        }
        if ($this->properties['minscale'] !== false) {
            $options['minScale'] = $this->properties['minscale'];
        }
        if ($this->properties['maxscale'] !== false) {
            $options['maxScale'] = $this->properties['maxscale'];
        }
        $options = Xml::encodeJsVar((object) $options);
        //js-encode all options );
        // for non-option params, get JavaScript-encoded config values:
        foreach ($this->properties as $name => $value) {
            ${$name} = MapsMapper::encodeJsVar($value);
        }
        return <<<JavaScript
new OpenLayers.Layer.Image(
\t{$label},
\t{$source},
\tnew OpenLayers.Bounds({$leftextent}, {$bottomextent}, {$rightextent}, {$topextent}),
\tnew OpenLayers.Size({$width}, {$height}),
\t{$options}
);
JavaScript;
        die;
    }