Hey Guys,

I've wrote this *addCircle* function for WGoogleMap class, I thought you
might want it as well  ( check the attachment ) :-)
Btw, it only works with API v3 .

-- 
Kind Regards,
Dushan Savich
[email protected]
http://stosha.com/
+381 64 329 33 55
Nehruova 95/51
11070 New Belgrade
Belgrade
Serbia
    void CustomGoogleMap::addCircle ( const Coordinate& pos, double radius )
    {
     
       
        if ( apiVersion_ == Version2 )
        {
            cout << "This function works only for version v3!\n";
            return;
        }

        std::string js =
                "var mapLocal = %1%;"
                "var latLng = new google.maps.LatLng(%2%, %3%);  "
                "var marker = new google.maps.Marker({"
                "  map: mapLocal,"
                "  position: latLng,"
                "  draggable: false  "
                "}); "
                "var circle = new google.maps.Circle( "
                "                      { "
                "                    map: mapLocal, "
                "                    radius: %4% , "
                "                    center:  latLng  ,"
                "                    fillOpacity: 0.2,"
                "                    fillColor: '#2277DD',"
                "                    strokeWeight: 2,"
                "                    strokeColor: '#1D007D',"
                "                    strokeOpacity: 1.0"
                "                      }"
                "                   );"
                "circle.bindTo('center', marker, 'position');";
       
       
        std::string mapVar  = jsRef() + ".map";

        js = (boost::format(js) % mapVar % pos.latitude() % pos.longitude() % radius).str();
       
        cout << "JS Circle: " << js << endl;
       
        doGmJavaScript ( js, true );
    }
------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to