Your address will show here +12 34 56 78

This topic contains 4 replies, has 1 voice, and was last updated by  Tomas 3 years, 8 months ago.

  • Author
    Posts
  • #23551

    Tomas

    Hi Anna,

    I want to add a zoom option to google_map_submit.js, to improve the users experience when adding the location to a property.

    I checked , and it refer to the following code that must be use within the MapOptions object:


    zoomControl: true,
    zoomControlOptions: {
    style: google.maps.ZoomControlStyle.SMALL
    }

    I used this function to modify google_map_submit.js, and the result is shown below:


    var mapOptions = {
    flat:false,
    noClear:false,
    zoom: 17,
    scrollwheel: true,
    draggable: true,
    disableDefaultUI:true,
    center: new google.maps.LatLng( listing_lat, listing_lon),
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    zoomControl: true,
    zoomControlOptions: {
    style: google.maps.ZoomControlStyle.DEFAULT
    }
    };

    However, something is wrong with the code because the zoom control is not showing. Do you see any problems with this code or its implementation?

    Thanks for your help!
    Tomas

  • #23552

    Tomas

    Reference:

    The code that I am using can be found in Google Maps JavaScript API v3 documentation:

    https://developers.google.com/maps/documentation/javascript/controls?hl=en

  • #23582

    crerem

    Try like this

    var mapOptions = {
    flat:false,
    noClear:false,
    zoom: 17,
    scrollwheel: true,
    draggable: true,
    disableDefaultUI:false,
    center: new google.maps.LatLng( listing_lat, listing_lon),
    mapTypeId: google.maps.MapTypeId.ROADMAP
    };

    doensn’t work pls reply with a live url

  • #23586

    Tomas

    Hi Crerem,

    The code is working great…!!! =)

    The only thing remaining are the styles. I need to adjust the image “mapcnt3.png” to the new layout. Could you give me the name of the css file that is responsible for setting up the styles.

    If you send me an email I can give you admin access to the website.

    Thanks again for your help!

    Regards,
    Tomas

  • #23682

    Tomas

    Hi Crerem,

    I run a multi file search and there is no evidence on a “class” or “id” for styling the map. Maybe it’s coming from google’s map API. I see the source code using chrome developer tool, but I can’t target this code and modify the styles.

    This is a screenshot of what I see,
    http://www.flickr.com/photos/[email protected]/12680837693/

    Do you have any suggestions? Is it possible to use google.maps.ZoomControlStyle.DEFAULT instead?

    I also want to make a small suggest for the coordinates. It will be great if old coordinates can disappear when the user clicks on a new position. This will prevent having several coordinates in the map at the same time.

    Thanks again for your help!!

    Best Regards,
    Tomas

You must be logged in to reply to this topic.