Skip to content

Commit 3760b84

Browse files
paodbmlopezFC
authored andcommitted
feat(demo): add kml demo
1 parent fa5b788 commit 3760b84

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

src/test/java/com/flowingcode/vaadin/addons/googlemaps/GooglemapsDemoView.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public GooglemapsDemoView() {
3838
addDemo(new DisableUIControlsDemo());
3939
addDemo(new CloudBasedMapStylingDemo());
4040
addDemo(new ControlSizeDemo());
41+
addDemo(new KMLLayerDemo());
4142
setSizeFull();
4243
}
4344
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*-
2+
* #%L
3+
* Google Maps Addon
4+
* %%
5+
* Copyright (C) 2020 - 2021 Flowing Code
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
20+
package com.flowingcode.vaadin.addons.googlemaps;
21+
22+
import com.flowingcode.vaadin.addons.demo.DemoSource;
23+
import com.flowingcode.vaadin.addons.googlemaps.GoogleMap.MapType;
24+
import com.vaadin.flow.router.PageTitle;
25+
26+
@PageTitle("KML Demo")
27+
@DemoSource(
28+
"https://github.com/FlowingCode/GoogleMapsAddon/blob/master/src/test/java/com/flowingcode/vaadin/addons/googlemaps/KMLLayerDemo.java")
29+
@SuppressWarnings("serial")
30+
public class KMLLayerDemo extends AbstractGoogleMapsDemo {
31+
32+
@Override
33+
protected void createGoogleMapsDemo(String apiKey) {
34+
GoogleMap gmaps = new GoogleMap(apiKey, null, null);
35+
gmaps.setMapType(MapType.ROADMAP);
36+
gmaps.setSizeFull();
37+
gmaps.setKml("https://developers.google.com/maps/documentation/javascript/examples/kml/westcampus.kml");
38+
add(gmaps);
39+
}
40+
}

0 commit comments

Comments
 (0)