Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MapControl extends Nette\Object
- {
- /**
- * @param string $centerAddress
- * @param array $markers
- * @param array $attrs
- */
- public function render($centerAddress, array $markers = array(), array $attrs = array())
- {
- $query = http_build_query($attrs + array(
- 'center' => $centerAddress,
- 'zoom' => 13,
- 'size' => '600x300',
- 'maptype' => 'roadmap',
- 'sensor' => 'false',
- ));
- foreach ($markers as $marker) {
- $query .= '&markers=' . urlencode($marker);
- }
- echo Html::el()->src('http://maps.googleapis.com/maps/api/staticmap?' . $query);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment