We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I think I have manage to create something usefull :
Mapper.php:
/** * Add a new map 3d building. * * @param array $coordinates * @param array $bottomOptions * @param array $topOptions * @param array $wallsOptions * @param array $height * * @return self */ public function building(array $coordinates = [], array $bottomOptions = [], array $topOptions = [], array $wallsOptions = [], $height = 0.1) { $i = 0; foreach($coordinates as $coord){ $bottom[$i]['latitude'] = $coord['latitude']; $bottom[$i]['longitude'] = $coord['longitude']; $top[$i]['latitude'] = $coord['latitude'] + $height; $top[$i]['longitude'] = $coord['longitude'] + $height; $i++; } $i--; //bottom $this->polygon($bottom, $bottomOptions); //roof $this->polygon($top, $topOptions); //walls for($w = $i; $w >= 0; $w--){ $z= $w - 1; if($w === 0) $z = $i; $this->polygon([$bottom[$w], $bottom[$z], $top[$z], $top[$w]], $wallsOptions); } return $this; }
Example:
Mapper::map(1, 1, ['zoom' => 8, 'center' => true]); $coordinates = [['latitude' => 1, 'longitude' => 1], ['latitude' => 3, 'longitude' => 1], ['latitude' => 3, 'longitude' => 3], ['latitude' => 1, 'longitude' => 3], ['latitude' => 0, 'longitude' => 1.2], ['latitude' => 0.5, 'longitude' => 1.5]]; $bottomOptions = ['fillColor' => 'red', 'strokeColor' => 'red', 'strokeOpacity' => 0.5]; $topOptions = ['fillColor' => 'blue', 'strokeColor' => 'blue', 'strokeWeight' => 5, 'strokeOpacity' => 1, 'fillOpacity' => 1]; $wallsOptions = ['fillColor' => 'yellow', 'strokeColor' => 'yellow', 'strokeOpacity' => 0.1]; $height = 0.5; Mapper::building($coordinates, $bottomOptions, $topOptions, $wallsOptions, $height);
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I think I have manage to create something usefull :
Mapper.php:
Example:
The text was updated successfully, but these errors were encountered: