-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add possibility to style map features and elements
Close #123
- Loading branch information
1 parent
4e47357
commit f757778
Showing
9 changed files
with
701 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
src/main/java/com/flowingcode/vaadin/addons/googlemaps/maptypestyle/ElementType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/*- | ||
* #%L | ||
* Google Maps Addon | ||
* %% | ||
* Copyright (C) 2020 - 2024 Flowing Code | ||
* %% | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* #L% | ||
*/ | ||
|
||
package com.flowingcode.vaadin.addons.googlemaps.maptypestyle; | ||
|
||
import lombok.Getter; | ||
|
||
/** | ||
* Enum representing supported element types. Elements are subdivisions of a feature. | ||
*/ | ||
public enum ElementType { | ||
|
||
/** | ||
* Selects all elements of the specified feature. Is the default option. | ||
*/ | ||
ALL("all"), | ||
|
||
/** | ||
* Selects all geometric elements of the specified feature. | ||
*/ | ||
GEOMETRY("geometry"), | ||
|
||
/** | ||
* Selects only the fill of the feature's geometry. | ||
*/ | ||
GEOMETRY_FILL("geometry.fill"), | ||
|
||
/** | ||
* Selects only the stroke of the feature's geometry. | ||
*/ | ||
GEOMETRY_STROKE("geometry.stroke"), | ||
|
||
/** | ||
* Selects the textual labels associated with the specified feature. | ||
*/ | ||
LABELS("labels"), | ||
|
||
/** | ||
* Selects only the icon displayed within the feature's label. | ||
*/ | ||
LABELS_ICON("labels.icon"), | ||
|
||
/** | ||
* Selects only the text of the label. | ||
*/ | ||
LABELS_TEXT("labels.text"), | ||
|
||
/** | ||
* Selects only the fill of the label. The fill of a label is typically rendered as a colored | ||
* outline that surrounds the label text. | ||
*/ | ||
LABELS_TEXT_FILL("labels.text.fill"), | ||
|
||
/** | ||
* Selects only the stroke of the label's text. | ||
*/ | ||
LABELS_TEXT_STROKE("labels.text.stroke"); | ||
|
||
@Getter | ||
private String value; | ||
|
||
ElementType(String value) { | ||
this.value = value; | ||
} | ||
|
||
} |
208 changes: 208 additions & 0 deletions
208
src/main/java/com/flowingcode/vaadin/addons/googlemaps/maptypestyle/FeatureType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,208 @@ | ||
/*- | ||
* #%L | ||
* Google Maps Addon | ||
* %% | ||
* Copyright (C) 2020 - 2024 Flowing Code | ||
* %% | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* #L% | ||
*/ | ||
|
||
package com.flowingcode.vaadin.addons.googlemaps.maptypestyle; | ||
|
||
import lombok.Getter; | ||
|
||
/** | ||
* Enum representing supported feature types. Features are geographic characteristics on the | ||
* map, including roads, parks, bodies of water, businesses, and more. | ||
*/ | ||
public enum FeatureType { | ||
|
||
/** | ||
* Selects all features. Is the default option. | ||
*/ | ||
ALL("all"), | ||
|
||
/** | ||
* Selects all administrative areas. Styling affects only the labels of administrative areas, not | ||
* the geographical borders or fill. | ||
*/ | ||
ADMINISTRATIVE("administrative"), | ||
|
||
/** | ||
* Selects countries. | ||
*/ | ||
ADMINISTRATIVE_COUNTRY("administrative.country"), | ||
|
||
/** | ||
* Selects land parcels. | ||
*/ | ||
ADMINISTRATIVE_LAND_PARCEL("administrative.land_parcel"), | ||
|
||
|
||
/** | ||
* Selects localities. | ||
*/ | ||
ADMINISTRATIVE_LOCALITY("administrative.locality"), | ||
|
||
|
||
/** | ||
* Selects neighborhoods. | ||
*/ | ||
ADMINISTRATIVE_NEIGHBORHOOD("administrative.neighborhood"), | ||
|
||
|
||
/** | ||
* Selects provinces. | ||
*/ | ||
ADMINISTRATIVE_PROVINCE("administrative.province"), | ||
|
||
/** | ||
* Selects all landscapes. | ||
*/ | ||
LANDSCAPE("landscape"), | ||
|
||
/** | ||
* Selects man-made features, such as buildings and other structures. | ||
*/ | ||
LANDSCAPE_MAN_MADE("landscape.man_made"), | ||
|
||
/** | ||
* Selects natural features, such as mountains, rivers, deserts, and glaciers.. | ||
*/ | ||
LANDSCAPE_NATURAL("landscape.natural"), | ||
|
||
/** | ||
* Selects land cover features, the physical material that covers the earth's surface, such as | ||
* forests, grasslands, wetlands, and bare ground.. | ||
*/ | ||
LANDSCAPE_NATURAL_LANDCOVER("landscape.natural.landcover"), | ||
|
||
/** | ||
* Selects terrain features of a land surface, such as elevation, slope, and orientation. | ||
*/ | ||
LANDSCAPE_NATURAL_TERRAIN("landscape.natural.terrain"), | ||
|
||
/** | ||
* Selects all points of interest. | ||
*/ | ||
POI("poi"), | ||
|
||
/** | ||
* Selects tourist attractions. | ||
*/ | ||
POI_ATTRACTION("poi.attraction"), | ||
|
||
/** | ||
* Selects businesses. | ||
*/ | ||
POI_BUSINESS("poi.business"), | ||
|
||
/** | ||
* Selects government buildings. | ||
*/ | ||
POI_GOVERNMENT("poi.government"), | ||
|
||
/** | ||
* Selects emergency services, including hospitals, pharmacies, police, doctors, and others. | ||
*/ | ||
POI_MEDICAL("poi.medical"), | ||
|
||
/** | ||
* Selects parks. | ||
*/ | ||
POI_PARK("poi.park"), | ||
|
||
/** | ||
* Selects places of worship, including churches, temples, mosques, and others. | ||
*/ | ||
POI_PLACE_OF_WORSHIP("poi.place_of_worship"), | ||
|
||
/** | ||
* Selects schools. | ||
*/ | ||
POI_SCHOOL("poi.school"), | ||
|
||
/** | ||
* Selects sports complexes. | ||
*/ | ||
POI_SPORTS_COMPLEX("poi.sports_complex"), | ||
|
||
/** | ||
* Selects all roads. | ||
*/ | ||
ROAD("road"), | ||
|
||
/** | ||
* Selects arterial roads. | ||
*/ | ||
ROAD_ARTERIAL("road.arterial"), | ||
|
||
/** | ||
* Selects highways. | ||
*/ | ||
ROAD_HIGHWAY("road.highway"), | ||
|
||
/** | ||
* Selects highways with controlled access. | ||
*/ | ||
ROAD_HIGHWAY_CONTROLLED_ACCESS("road.highway.controlled_access"), | ||
|
||
/** | ||
* Selects local roads. | ||
*/ | ||
ROAD_LOCAL("road.local"), | ||
|
||
/** | ||
* Selects all transit stations and lines. | ||
*/ | ||
TRANSIT("transit"), | ||
|
||
/** | ||
* Selects transit lines. | ||
*/ | ||
TRANSIT_LINE("transit.line"), | ||
|
||
/** | ||
* Selects transit stations. | ||
*/ | ||
TRANSIT_STATION("transit.station"), | ||
|
||
/** | ||
* Selects airports. | ||
*/ | ||
TRANSIT_STATION_AIRPORT("transit.station.airport"), | ||
|
||
/** | ||
* Selects bus stops. | ||
*/ | ||
TRANSIT_STATION_BUS("transit.station.bus"), | ||
|
||
/** | ||
* Selects rail stations. | ||
*/ | ||
TRANSIT_STATION_RAIL("transit.station.rail"), | ||
|
||
/** | ||
* Selects bodies of water. | ||
*/ | ||
WATER("water"); | ||
|
||
@Getter | ||
private String value; | ||
|
||
FeatureType(String value) { | ||
this.value = value; | ||
} | ||
|
||
} |
Oops, something went wrong.