HTML Questions & Answers – HTML Google Maps – 1

This set of HTML Multiple Choice Questions & Answers (MCQs) focuses on “HTML Google Maps – 1”.

1. Which of the following map type is not supported by mapTypeId?
a) Hybrid
b) Terrain
c) Roadmap
d) Climatic map
View Answer

Answer: d
Explanation: The map type that is to be displayed is specified by mapTypeId. The types that are supported are Satellite, Roadmap, Terrain and hybrid. E.g. mapTypeId: google.maps.MapTypeId.ROADMAP.

2. Which one of the following defines properties for the map?
a) mapOptions
b) zoom
c) center
d) mapTypeId
View Answer

Answer: a
Explanation: The variable mapOptions defines the properties of the map. Where to center the map is defined by center property, it uses longitude and latitude properties. To specify the zoom level for the map we use zoom property.

3. Which one of the following is not google map overlay?
a) Polygon
b) Polyline
c) Eclipse
d) Marker
View Answer

Answer: c
Explanation: The objects on the map that are bound to longitude/latitude coordinates are overlays. Google Maps has many types of overlays. Marker, Polygon, Polyline, Circle, Rectangle, Info Windows, Custom overlays etc.
advertisement
advertisement

4. For single locations on a map, we use the overlay for _______
a) Marker
b) Polygon
c) Polyline
d) Circle
View Answer

Answer: a
Explanation: Marker specifies the single locations on the map. It can also display custom icon images. A series of straight lines on a map can be specified by Polyline. A series of a straight line with the “closed” shape is defined by Polygon.

5. Polyline will not support the property of _________
a) Path
b) StrokeOpacity
c) Editable
d) Fillcolor
View Answer

Answer: d
Explanation: Polyline supports various properties like strokeColor, strokeWeight, editable, strokeOpacity, path. The several longitude or latitude coordinates for a line is specified by path. An opacity of the line is specified by strokeOpacity.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. The property that is not supported by Polyline but by Polygon is __________
a) strokeWeight
b) fillOpacity
c) path
d) editable
View Answer

Answer: b
Explanation: The properties supported by polygon are strokeColor, strokeWeight, editable, fillOpacity, fillColor, path, strokeCapacity. The hexadecimal color for the area within an enclosed region is specified by fillColor, the opacity to fill color is specified by fillOpacity.

7. The property which is not supported by the circle is _________
a) path
b) radius
c) center
d) fillColor
View Answer

Answer: a
Explanation: Circle supports the properties like radius, center, strokeOpacity, strokeCapacity, fillColor, fillOpacity, stokeOpacity, editable, specify google.maps.LatLng of center of circle, the radius of a circle is specified by radius. Opacity of stroke color is specified by strokeOpacity.
advertisement

8. The value of fillOpacity lies between __________
a) 0.0 and 2.0
b) 0.0 and 1.0
c) 2.0 and 3.0
d) 3.0 and 4.0
View Answer

Answer: b
Explanation: The value of fillOpacity lies between 0.0 and 1.0. The value of strokeOpacity also lies between 0.0 and 1.0, E.g path: Trip, strokeOpacity: 0.7, strokeWeight: 3, strokeColor: “#000FFF” .

9. Which one of the following is not the default control in google maps?
a) Pan
b) Street view
c) MapType
d) Climate map
View Answer

Answer: d
Explanation: Google map has a default control set namely Pan, Zoom, Street view, MapType, Rotate, Overview map, scale. A slider or “+/-” buttons for controlling zoom level of the map. For panning the map we use pan control.
advertisement

10. Which control displays the current map viewport?
a) Scale
b) Overview Map
c) Street view
d) MapType
View Answer

Answer: b
Explanation: The control overview displays a thumbnail overview map which reflects the current map viewport within the wider area. A map scale element is displayed by scale control. Pegman icon that can be dragged to the map for enabling street view is displayed by this control. When a user wants to toggle between the maps (roadmap and satellite), Map Type is used.

11. MapTypeControlOptions field may not contain _______
a) google.maps.MapTypeControlStyle.HORZONTAL_BAR
b) google.maps.MapTypeControlStyle.DEFAULT
c) google.maps.MapTypeControlStyle.DROPDOWN_MENU
d) google.maps.MapTypeControlStyle.LARGE
View Answer

Answer: d
Explanation: For modifying control we use mapTypeControlOptions field. google.maps.MapTypeControlStyle.HORZONTAL_BAR displays a single button for each map type. google.maps.MapTypeControlStyle.DEFAULT displays default behavior. google.maps.MapTypeControlStyle.DROPDOWN_MENU helps in selecting map type via dropdown menu.

12. Photographic map lies under the map type ____________
a) satellite
b) roadmap
c) hybrid
d) terrain
View Answer

Answer: a
Explanation: Photographic map lies under the map type satellite. Default 2D map and normal maps lie under the type roadmap. Photographic + city and roads names include hybrid maps. Maps with rivers, mountains etc. lies under the category terrain.

13. Which of the following type will support 45 degree perspective view?
a) Terrain
b) Hybrid
c) Roadmap
d) Climate map
View Answer

Answer: b
Explanation: Satellite and hybrid type of map support 45 degree perspective imagery view for specified locations. The map will add a compass wheel around Pan control, it allows to rotate the image. There is a toggle control to display 45 degree perspective view.

14. Which of the following method will return DOM object that contains map?
a) getCenter()
b) getProjection()
c) getDiv()
d) gettilt()
View Answer

Answer: c
Explanation: getDiv() method will return DOM object that contains map. Its return type is node. getCenter() will return lng/lat of center of the map. getTilt() method will return angle of incidence for aerial imagery in degrees. Current position is returned when getProjection() event is fired up.

15. Which one of the following will set the viewport to contain given bounds?
a) fitBounds()
b) getBounds()
c) getHeading()
d) panTo()
View Answer

Answer: a
Explanation: fitBounds() method sets viewport to contain given bounds. Its parameters are LAtLngBounds. The return value of getBounds() is LatLng, LatLng. getHeading will return compass heading of the aerial imager. Its return type is number. The center of the map to the given LatLng can be changed by the panTo() event.

Sanfoundry Global Education & Learning Series – HTML.

To practice all areas of HTML, here is complete set of 1000+ Multiple Choice Questions and Answers.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.