Skip to content

Commit

Permalink
Add JSO wrapper for MarkerClustererPlus
Browse files Browse the repository at this point in the history
  • Loading branch information
tvernum committed Feb 26, 2013
1 parent 7a04609 commit 68f32c9
Show file tree
Hide file tree
Showing 11 changed files with 696 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .gitignore
Expand Up @@ -2,6 +2,8 @@
**.classpath
**.project
**.settings
**.iml
**.idea
gwt-unitCache**
target**
www-test**
Expand All @@ -10,4 +12,4 @@ apis_maps_test**
lib**
src_maps**
**/bin**
**/.gwt**
**/.gwt**
138 changes: 138 additions & 0 deletions gwt-maps-utility/markerclustererplus/pom.xml
@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.github.branflake2267</groupId>
<artifactId>gwt-maps</artifactId>
<version>3.9.0-build-17</version>
</parent>

<artifactId>gwt-maps-utility-markerclustererplus</artifactId>
<name>GWT Maps API V3 - Utility API - MarkerClustererPlus</name>
<version>2.0.15-SNAPSHOT</version>

<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.java</include>
<include>**/*.gwt.xml</include>
</includes>
</resource>
</resources>

<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<excludes>
<exclude>**/*GwtTest.java</exclude>
</excludes>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>${gwt.maven.version}</version>
<configuration>
<extraJvmArgs>-Xss1024k -Xmx512M</extraJvmArgs>
<includes>**/*GwtTestSuite.java</includes>
<excludes>**/*GwtTest.java</excludes>
<mode>htmlunit</mode>
<testTimeOut>180</testTimeOut>
<strict>true</strict>
<style>${gwt.style}</style>
<compileSourcesArtifacts>
<compileSourcesArtifact>com.google.gwt.maps:Maps</compileSourcesArtifact>
</compileSourcesArtifacts>
</configuration>
<executions>
<execution>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwt.version}</version>
</dependency>
</dependencies>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>

</plugins>

</build>

<dependencies>
<!-- GWT -->
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
</dependency>
<dependency>
<groupId>com.github.branflake2267</groupId>
<artifactId>gwt-maps-api</artifactId>
<version>3.9.0-build-17</version>
</dependency>
</dependencies>

<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
<executions>
<execution>
<id>attach-javadocs</id>
<phase>verify</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>

@@ -0,0 +1,45 @@
<!--
#%L
GWT Maps API V3 - Utility API - MarkerClustererPlus
%%
Copyright (C) 2011 - 2013 GWT Maps API V3
%%
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%
-->
<!--
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.
-->
<!DOCTYPE module PUBLIC "//gwt-module/" "http://google-web-toolkit.googlecode.com/svn/tags/1.6.2/distro-source/core/src/gwt-module.dtd">
<module> <!-- rename-to='markerclustererplus'> -->

<!-- GWT Core -->
<inherits name='com.google.gwt.user.User' />

<!-- GWT Maps -->
<inherits name='com.google.gwt.maps.Maps' />

<!-- translate the client to javascript -->
<source path='client' />

</module>
@@ -0,0 +1,28 @@
package com.google.gwt.maps.utility.markerclustererplus.client;

/*
* #%L
* GWT Maps API V3 - Utility API - MarkerClustererPlus
* %%
* Copyright (C) 2011 - 2013 GWT Maps API V3
* %%
* 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%
*/

import com.google.gwt.core.client.JsArray;
import com.google.gwt.maps.client.overlays.Marker;

public interface ClusterCalculator {
ClusterIconInfo execute(JsArray<Marker> markers, int numStyles);
}
@@ -0,0 +1,58 @@
package com.google.gwt.maps.utility.markerclustererplus.client;

/*
* #%L
* GWT Maps API V3 - Utility API - MarkerClustererPlus
* %%
* Copyright (C) 2011 - 2013 GWT Maps API V3
* %%
* 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%
*/

import com.google.gwt.core.client.JavaScriptObject;

public class ClusterIconInfo extends JavaScriptObject {

protected ClusterIconInfo() {
}

public static ClusterIconInfo getInstance() {
JavaScriptObject jso = JavaScriptObject.createObject();
return jso.cast();
}

public final native int getIndex() /*-{
return this.index;
}-*/;

public final native void setIndex(int index) /*-{
this.index = index;
}-*/;

public final native int getText() /*-{
return this.text;
}-*/;

public final native void setText(String text) /*-{
this.text = text;
}-*/;

public final native String getTitle() /*-{
return this.title;
}-*/;

public final native void setTitle(String title) /*-{
this.title = title;
}-*/;
}
@@ -0,0 +1,90 @@
package com.google.gwt.maps.utility.markerclustererplus.client;

/*
* #%L
* GWT Maps API V3 - Utility API - MarkerClustererPlus
* %%
* Copyright (C) 2011 - 2013 GWT Maps API V3
* %%
* 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%
*/

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArrayInteger;

public class ClusterIconStyle extends JavaScriptObject {

protected ClusterIconStyle() {
}

public static ClusterIconStyle getInstance() {
return createObject().cast();
}

public final void setAnchor(int yOffset, int xOffset) {
setAnchor(JsUtil.toIntegerArray(yOffset, xOffset));
}

public final native void setAnchor(JsArrayInteger value) /*-{
this.anchor = value;
}-*/;

public final void setAnchorIcon(int yOffset, int xOffset) {
setAnchorIcon(JsUtil.toIntegerArray(yOffset, xOffset));
}

public final native void setAnchorIcon(JsArrayInteger value) /*-{
this.anchorIcon = value;
}-*/;

public final native void setBackgroundPosition(String value) /*-{
this.backgroundPosition = value;
}-*/;

public final native void setFontFamily(String value) /*-{
this.fontFamily = value;
}-*/;

public final native void setFontStyle(String value) /*-{
this.fontStyle = value;
}-*/;

public final native void setFontWeight(String value) /*-{
this.fontWeight = value;
}-*/;

public final native void setHeight(int value) /*-{
this.height = value;
}-*/;

public final native void setTextColor(String value) /*-{
this.textColor = value;
}-*/;

public final native void setTextDecoration(String value) /*-{
this.textDecoration = value;
}-*/;

public final native void setTextSize(int value) /*-{
this.textSize = value;
}-*/;

public final native void setUrl(String value) /*-{
this.url = value;
}-*/;

public final native void setWidth(int value) /*-{
this.width = value;
}-*/;
}

0 comments on commit 68f32c9

Please sign in to comment.