本文整理汇总了PHP中Map::options2Js方法的典型用法代码示例。如果您正苦于以下问题:PHP Map::options2Js方法的具体用法?PHP Map::options2Js怎么用?PHP Map::options2Js使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map
的用法示例。
在下文中一共展示了Map::options2Js方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toJs
/**
* Generates the object's JavaScript code
*
* @param Map $map The map widget
* @return JsExpression Object JavaScript code
*/
public function toJs($map)
{
return $this->toJsExpression("{$map->leafletVar}.control.fullscreen({$map->options2Js($this->options)})");
}
示例2: toJs
/**
* Generates the object's JavaScript code
*
* @param Map $map The map widget
* @return JsExpression Object JavaScript code
*/
public function toJs($map)
{
return $this->toJsExpression("{$map->leafletVar}.gridLayer({$map->options2Js($this->options)})" . $map->events2Js($this->events));
}
示例3: toJs
/**
* Generates the object's JavaScript code
*
* @param Map $map The map widget
* @return JsExpression Object JavaScript code
*/
public function toJs($map)
{
return new JsExpression("{$map->leafletVar}.icon({$map->options2Js($this->options)})");
}
示例4: toJs
/**
* Generates the object's JavaScript code
*
* @param Map $map The map widget
* @return JsExpression Object JavaScript code
*/
public function toJs($map)
{
$baseLayers = $overlays = [];
foreach ($this->_baseLayers as $key => $layer) {
$baseLayers[$key] = $layer->jsVar;
}
foreach ($this->_overlays as $key => $layer) {
$overlays[$key] = $layer->jsVar;
}
$baseLayers = Json::encode($baseLayers);
$overlays = Json::encode($overlays);
return $this->toJsExpression("{$map->leafletVar}.control.layers({$baseLayers}, {$overlays}, {$map->options2Js($this->options)})");
}
示例5: toJs
/**
* Generates the object's JavaScript code
*
* @param Map $map The map widget
* @return JsExpression Object JavaScript code
*/
public function toJs($map)
{
$latLngs = Json::encode($this->getLatLngs());
return $this->toJsExpression("{$map->leafletVar}.polyline\n ({$latLngs}, {$map->options2Js($this->options)})" . $map->events2Js($this->events));
}
示例6: toJs
/**
* Generates the object's JavaScript code
*
* @param Map $map The map widget
* @return JsExpression Object JavaScript code
*/
public function toJs($map)
{
return $this->toJsExpression("{$map->leafletVar}.popup({$map->options2Js($this->options)}).setContent('{$this->_content}').setLatLng({$this->getLatLng()->toJs($map)})" . $map->events2Js($this->events));
}
示例7: toJs
/**
* Generates the object's JavaScript code
*
* @param Map $map The map widget
* @return JsExpression Object JavaScript code
*/
public function toJs($map)
{
return $this->toJsExpression("{$map->leafletVar}.tileLayer('{$this->_url}', {$map->options2Js($this->options)})" . $map->events2Js($this->events));
}
示例8: toJs
/**
* Generates the object's JavaScript code
*
* @param Map $map The map widget
* @return JsExpression Object JavaScript code
*/
public function toJs($map)
{
$data = Json::encode($this->_data);
return $this->toJsExpression("{$map->leafletVar}.geoJson({$data}, {$map->options2Js($this->options)})" . $map->events2Js($this->events));
}