Skip to main content
Known Participant
August 31, 2011
Question

CFMAP to disable panning in Google?

  • August 31, 2011
  • 1 reply
  • 1748 views

Hello,

I have a Google Map embedded in my website using cfmap. I would like to "lock" the map location, or disable panning so the user can not move where the map is centered. Is this possible using cfmap? I have tried to use the disableDragging() javascript function with no luck...any suggestions?

<cfoutput>
  <cfmap centeraddress="#lat#, #long#" width="400" height="400" zoomLevel="18" type="hybrid"  scrollwheelzoom="false" showCenterMarker="false" overview = "false" >
  <cfloop query="mrs2">
  <cfmapitem latitude="#lat#"
        longitude="#long#"
  tip="#POINT_NAME#">
  </cfloop>
  </cfmap>
     </cfoutput>

Thanks!

    This topic has been closed for replies.

    1 reply

    Inspiring
    August 31, 2011

    Interesting.  I don't think one can do it with CFMAP.

    It might be worth raising an enhacement request of Adobe:

    http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html

    And then look throught eh Google API, as I am sure there'll be a way to do it (I shall research this myself...)

    --
    Adam

    Inspiring
    August 31, 2011

    I consulted with my resident Google maps expert, and he pointed me to this:

    http://code.google.com/apis/maps/documentation/javascript/reference.html#MapOptions

    Which looks like stuff you've already read.  He was bemused at why the disableDragging thing didn't work for you.

    Could you produce some self-contained and stand-alone code that shows how you were trying this?  I'll give me something to go on.

    He also pointed me to this:

    http://code.google.com/apis/maps/documentation/staticmaps/

    That could be an option?  Possibly too restrictive for what you want.

    --

    Adam

    Known Participant
    August 31, 2011

    Here is my code for the whole page. I am not a javascript expert, so I am sure I am doing something wrong with the disableDragging() function. I am just confused on how to integrate the cf and javascript together in this instance.

    Thanks for your help!!!








    function initialize() {



    var map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);



    var marker = new google.maps.Marker({


    map: map,


    position: results[0].geometry.location


    });


    map.disableDragging();


    }


    });



    }


    <body topmargin=10 leftmargin=10 <!-onLoad="window.resizeTo(1280,1024)"->>

    </html