function PointRadiusGeozone(gMap, zNdx,
    lat, lon, radiusM, color, editable)
{
    var self = this;

    /* circle attributes */
    this.googleMap        = gMap;
    this.zoneIndex        = zNdx;
    this.radiusMeters     = (radiusM <= MAX_ZONE_RADIUS_M)? Math.round(radiusM) : MAX_ZONE_RADIUS_M;
    this.radiusPoint      = null;
    this.centerMarker     = null;
    this.radiusMarker     = null;
    this.circlePolygon    = null;
    this.shapeColor       = (color && (color != ""))? color : "#0000FF";
    this.centerPoint      = jsNewGLatLng(lat, lon); // GLatLng

    /* center Icon/marker */
    if (editable) {

        /* create draggable center marker */
        this.centerMarker = jsNewImageMarker(
            this.centerPoint,                                               // GLatLng
            "https://labs.google.com/ridefinder/images/mm_20_blue.png",      // image
            jsNewGSize(12,20),                                              // iconSize
            jsNewGPoint(6,20),                                              // iconAnchor
            "https://labs.google.com/ridefinder/images/mm_20_shadow.png",    // shadow
            jsNewGSize(22,20),                                              // shadowSize
            null,                                                           // infoWindowAnchor
            true,                                                           // draggable
            -1                                                              // zIndex
            );
        this.centerMarker.setMap(this.googleMap);
        this.centerMarker.setDraggable(true);
        google.maps.event.addListener(this.centerMarker, "dragend", function(event) {
            var oldCP = self.centerPoint; // GLatLng
            var oldRP = self.radiusMarker.getPosition(); // GLatLng
            var newCP = self.centerMarker.getPosition(); // GLatLng
            var newRP = self.calcRadiusPoint(geoHeading(oldCP.lat(),oldCP.lng(),oldRP.lat(),oldRP.lng()));
            self.centerPoint = newCP;  // GLatLng
            self.radiusMarker.setPosition(newRP);
            self.drawCircle();
            jsmSetPointZoneValue(newCP.lat(), newCP.lng(), self.radiusMeters);
        });

        /* radius Icon/Marker */
        this.radiusPoint  = this.calcRadiusPoint(/*Global*/pointRadiusRadiusHeading); // GLatLng
        this.radiusMarker = jsNewImageMarker(
            this.radiusPoint,                                               // GLatLng
            "https://labs.google.com/ridefinder/images/mm_20_gray.png",      // image
            jsNewGSize(12,20),                                              // iconSize
            jsNewGPoint(6,20),                                              // iconAnchor
            "https://labs.google.com/ridefinder/images/mm_20_shadow.png",    // shadow
            jsNewGSize(22,20),                                              // shadowSize
            null,                                                           // infoWindowAnchor
            true,                                                           // draggable
            -1                                                              // zIndex
            );
        this.radiusMarker.setMap(this.googleMap); // this.googleMap.addOverlay(this.radiusMarker);
        this.radiusMarker.setDraggable(true); // enableDragging();
        google.maps.event.addListener(this.radiusMarker, "dragend", function(event) {
            var oldCP = self.centerMarker.getPosition();
            var newRP = self.radiusMarker.getPosition();
            var radM  = Math.round(geoDistanceMeters(oldCP.lat(),oldCP.lng(),newRP.lat(),newRP.lng()));
            self.radiusMeters = radM;
            pointRadiusRadiusHeading = geoHeading(oldCP.lat(),oldCP.lng(),newRP.lat(),newRP.lng());
            if (self.radiusMeters < MIN_ZONE_RADIUS_M) {
                self.radiusMeters = MIN_ZONE_RADIUS_M;
                newRP = self.calcRadiusPoint(pointRadiusRadiusHeading);
                self.radiusMarker.setPosition(newRP);
            } else
            if (self.radiusMeters > MAX_ZONE_RADIUS_M) {
                self.radiusMeters = MAX_ZONE_RADIUS_M;
                newRP = self.calcRadiusPoint(pointRadiusRadiusHeading);
                self.radiusMarker.setPosition(newRP); // .setPoint(newRP);
            }
            //self.drawCircle();  <-- redrawn during zoneReset below
            jsmSetPointZoneValue(oldCP.lat(), oldCP.lng(), self.radiusMeters);
            // need to redraw other point-radius zones as well
            _zoneReset();
        });

    } else {

        this.centerMarker = null;

    }

    /* draw circle */
    this.drawCircle();

}
/* this draws a single point-circle geozone */
this draws a single point-circle geozone
this draws a single point - circle geozone
function PointRadiusGeozone(gMap, zNdx,
    lat, lon, radiusM, color, editable)
{
    var self = this;
    this.googleMap        = gMap;
    this.zoneIndex        = zNdx;
    this.radiusMeters     = (radiusM <= MAX_ZONE_RADIUS_M)? Math.round(radiusM) : MAX_ZONE_RADIUS_M;
    this.radiusPoint      = null;
    this.centerMarker     = null;
    this.radiusMarker     = null;
    this.circlePolygon    = null;
    this.shapeColor       = (color && (color != ""))? color : "#0000FF";
    this.centerPoint      = jsNewGLatLng(lat, lon); 
    if (editable) {
        this.centerMarker = jsNewImageMarker(
            this.centerPoint,                                               
            "https://labs.google.com/ridefinder/images/mm_20_blue.png",      
            jsNewGSize(12,20),                                              
            jsNewGPoint(6,20),                                              
            "https://labs.google.com/ridefinder/images/mm_20_shadow.png",    
            jsNewGSize(22,20),                                              Size
            null,                                                           
            true,                                                           
            -1                                                              
            );
        this.centerMarker.setMap(this.googleMap);
        this.centerMarker.setDraggable(true);
        google.maps.event.addListener(this.centerMarker, "dragend", function(event) {
            var oldCP = self.centerPoint; 
            var oldRP = self.radiusMarker.getPosition(); 
            var newCP = self.centerMarker.getPosition(); 
            var newRP = self.calcRadiusPoint(geoHeading(oldCP.lat(),oldCP.lng(),oldRP.lat(),oldRP.lng()));
            self.centerPoint = newCP;  
            self.radiusMarker.setPosition(newRP);
            self.drawCircle();
            jsmSetPointZoneValue(newCP.lat(), newCP.lng(), self.radiusMeters);
        });
        this.radiusPoint  = this.calcRadiusPoint(pointRadiusRadiusHeading); 
        this.radiusMarker = jsNewImageMarker(
            this.radiusPoint,                                               
            "https://labs.google.com/ridefinder/images/mm_20_gray.png",      
            jsNewGSize(12,20),                                              
            jsNewGPoint(6,20),                                              
            "https://labs.google.com/ridefinder/images/mm_20_shadow.png",    
            jsNewGSize(22,20),                                              Size
            null,                                                           
            true,                                                           
            -1                                                              
            );
        this.radiusMarker.setMap(this.googleMap); 
        this.radiusMarker.setDraggable(true); 
        google.maps.event.addListener(this.radiusMarker, "dragend", function(event) {
            var oldCP = self.centerMarker.getPosition();
            var newRP = self.radiusMarker.getPosition();
            var radM  = Math.round(geoDistanceMeters(oldCP.lat(),oldCP.lng(),newRP.lat(),newRP.lng()));
            self.radiusMeters = radM;
            pointRadiusRadiusHeading = geoHeading(oldCP.lat(),oldCP.lng(),newRP.lat(),newRP.lng());
            if (self.radiusMeters < MIN_ZONE_RADIUS_M) {
                self.radiusMeters = MIN_ZONE_RADIUS_M;
                newRP = self.calcRadiusPoint(pointRadiusRadiusHeading);
                self.radiusMarker.setPosition(newRP);
            } else
            if (self.radiusMeters > MAX_ZONE_RADIUS_M) {
                self.radiusMeters = MAX_ZONE_RADIUS_M;
                newRP = self.calcRadiusPoint(pointRadiusRadiusHeading);
                self.radiusMarker.setPosition(newRP); 
            }
            jsmSetPointZoneValue(oldCP.lat(), oldCP.lng(), self.radiusMeters);
            _zoneReset();
        });
    } else {
        this.centerMarker = null;
    }
    this.drawCircle();
}
function PointRadiusGeozone ( gMap , zNdx , lat , lon , radiusM , color , editable ) { var self = this ; this . googleMap = gMap ; this . zoneIndex = zNdx ; this . radiusMeters = ( radiusM <= MAX_ZONE_RADIUS_M ) ? Math . round ( radiusM ) : MAX_ZONE_RADIUS_M ; this . radiusPoint = null ; this . centerMarker = null ; this . radiusMarker = null ; this . circlePolygon = null ; this . shapeColor = ( color && ( color != "" ) ) ? color : "#0000FF" ; this . centerPoint = jsNewGLatLng ( lat , lon ) ; if ( editable ) { this . centerMarker = jsNewImageMarker ( this . centerPoint , "https://labs.google.com/ridefinder/images/mm_20_blue.png" , jsNewGSize ( 12 , 20 ) , jsNewGPoint ( 6 , 20 ) , "https://labs.google.com/ridefinder/images/mm_20_shadow.png" , jsNewGSize ( 22 , 20 ) , null , true , - 1 ) ; this . centerMarker . setMap ( this . googleMap ) ; this . centerMarker . setDraggable ( true ) ; google . maps . event . addListener ( this . centerMarker , "dragend" , function ( event ) { var oldCP = self . centerPoint ; var oldRP = self . radiusMarker . getPosition ( ) ; var newCP = self . centerMarker . getPosition ( ) ; var newRP = self . calcRadiusPoint ( geoHeading ( oldCP . lat ( ) , oldCP . lng ( ) , oldRP . lat ( ) , oldRP . lng ( ) ) ) ; self . centerPoint = newCP ; self . radiusMarker . setPosition ( newRP ) ; self . drawCircle ( ) ; jsmSetPointZoneValue ( newCP . lat ( ) , newCP . lng ( ) , self . radiusMeters ) ; } ) ; this . radiusPoint = this . calcRadiusPoint ( pointRadiusRadiusHeading ) ; this . radiusMarker = jsNewImageMarker ( this . radiusPoint , "https://labs.google.com/ridefinder/images/mm_20_gray.png" , jsNewGSize ( 12 , 20 ) , jsNewGPoint ( 6 , 20 ) , "https://labs.google.com/ridefinder/images/mm_20_shadow.png" , jsNewGSize ( 22 , 20 ) , null , true , - 1 ) ; this . radiusMarker . setMap ( this . googleMap ) ; this . radiusMarker . setDraggable ( true ) ; google . maps . event . addListener ( this . radiusMarker , "dragend" , function ( event ) { var oldCP = self . centerMarker . getPosition ( ) ; var newRP = self . radiusMarker . getPosition ( ) ; var radM = Math . round ( geoDistanceMeters ( oldCP . lat ( ) , oldCP . lng ( ) , newRP . lat ( ) , newRP . lng ( ) ) ) ; self . radiusMeters = radM ; pointRadiusRadiusHeading = geoHeading ( oldCP . lat ( ) , oldCP . lng ( ) , newRP . lat ( ) , newRP . lng ( ) ) ; if ( self . radiusMeters < MIN_ZONE_RADIUS_M ) { self . radiusMeters = MIN_ZONE_RADIUS_M ; newRP = self . calcRadiusPoint ( pointRadiusRadiusHeading ) ; self . radiusMarker . setPosition ( newRP ) ; } else if ( self . radiusMeters > MAX_ZONE_RADIUS_M ) { self . radiusMeters = MAX_ZONE_RADIUS_M ; newRP = self . calcRadiusPoint ( pointRadiusRadiusHeading ) ; self . radiusMarker . setPosition ( newRP ) ; } jsmSetPointZoneValue ( oldCP . lat ( ) , oldCP . lng ( ) , self . radiusMeters ) ; _zoneReset ( ) ; } ) ; } else { this . centerMarker = null ; } this . drawCircle ( ) ; }
this draws a single point-circle geozone
this draws a single point - circle geozone
/* circle attributes */ // GLatLng /* center Icon/marker */ /* create draggable center marker */ // GLatLng // image // iconSize // iconAnchor // shadow // shadowSize // infoWindowAnchor // draggable // zIndex // GLatLng // GLatLng // GLatLng // GLatLng /* radius Icon/Marker */ /*Global*/ // GLatLng // GLatLng // image // iconSize // iconAnchor // shadow // shadowSize // infoWindowAnchor // draggable // zIndex // this.googleMap.addOverlay(this.radiusMarker); // enableDragging(); // .setPoint(newRP); //self.drawCircle();  <-- redrawn during zoneReset below // need to redraw other point-radius zones as well /* draw circle */