Skip to content

Commit

Permalink
For #100 - experimentally found koefficient for circle radius so draw…
Browse files Browse the repository at this point in the history
…ing will be very close to calculation
  • Loading branch information
vitalidze committed Mar 28, 2015
1 parent f231e67 commit bb42320
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -15,6 +15,8 @@
*/
package org.traccar.web.client.view;

import com.google.gwt.core.client.GWT;
import org.gwtopenmaps.openlayers.client.OpenLayers;
import org.gwtopenmaps.openlayers.client.Style;
import org.gwtopenmaps.openlayers.client.feature.VectorFeature;
import org.gwtopenmaps.openlayers.client.geometry.*;
Expand Down Expand Up @@ -64,7 +66,8 @@ public void removeGeoFence(GeoFence geoFence) {

private void drawCircle(GeoFence circle, boolean drawTitle) {
GeoFence.LonLat center = circle.points().get(0);
Polygon circleShape = Polygon.createRegularPolygon(mapView.createPoint(center.lon, center.lat), circle.getRadius(), 40, 0f);
float radius = circle.getRadius() * 1.78143299863f;
Polygon circleShape = Polygon.createRegularPolygon(mapView.createPoint(center.lon, center.lat), radius, 100, 0f);

Style st = new Style();
st.setFillOpacity(0.3);
Expand Down

0 comments on commit bb42320

Please sign in to comment.