Add a polygon to a map

Select platform: Android iOS

You can add a polygon to a 3D map.

A map view showing a polygon

The following code sample demonstrates how to use the Polygon struct to add a 3D polygon and position it on the map.

   
 Map 
 ( 
 mode 
 : 
  
 . 
 hybrid 
 ) 
  
 { 
  
 Polygon 
 ( 
  
 outerCoordinates 
 : 
  
 [ 
  
 . 
 init 
 ( 
 latitude 
 : 
  
 37.7749 
 , 
  
 longitude 
 : 
  
 - 
 122.4194 
 , 
  
 altitude 
 : 
  
 0 
 ), 
  
 . 
 init 
 ( 
 latitude 
 : 
  
 37.7740 
 , 
  
 longitude 
 : 
  
 - 
 122.4184 
 , 
  
 altitude 
 : 
  
 0 
 ), 
  
 . 
 init 
 ( 
 latitude 
 : 
  
 37.7750 
 , 
  
 longitude 
 : 
  
 - 
 122.4174 
 , 
  
 altitude 
 : 
  
 0 
 ), 
  
 ] 
  
 ) 
  
 } 
 
Create a Mobile Website
View Site in Mobile | Classic
Share by: