What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Why won't my Google Map switch to terrain?

    Asked by COREVI on September 25, 2014 at 04:42 PM

    I have a google map on my form where users click on the location where an invasive fish was removed and the form translates that to a geolocation. The coding was acquired through this help forum. I haven't done any changes to the code, but now the map will no longer give the option to switch to terrain mode and the zoom controls are gone. This is bad news as users are selecting locations in the ocean which required the terrain feature. Please fix this!

    Page URL:
    http://www.corevi.org/submit.html

    map Google map
  • Profile Image
    JotForm Support

    Answered by steve on September 25, 2014 at 08:33 PM

    Hello-

    I found the earlier thread where this was set up:

    https://www.jotform.com/answers/229804-How-to-Add-a-Geo-Marker-Google-Maps-Marker-for-Geolocation-purposes#45

    The sample GeoMarker page also does not have the terrain option:

    https://shots.jotform.com/dinesh/sampleGeoMarker.html

    If it used to work and now does not, then perhaps Google changed the API from the time this was set up. I'll research this a bit more to see if I can get the terrain option working. Will update this ticket with what I find.

    Thanks

  • Profile Image

    Answered by COREVI on September 27, 2014 at 01:47 PM

    Any update on the Google API? I would appreciate any insight into this as I'm losing data :(

  • Profile Image
    JotForm Support

    Answered by Kiran on September 27, 2014 at 05:59 PM

    @COREVI

    We apologize for the inconvenience caused. Your message has reached Steve and hopefully he is working on the issue and get back to you when he finds some relevant information. Thank you for your patience.

    Thank you.

  • Profile Image
    JotForm Support

    Answered by steve on September 27, 2014 at 09:45 PM

    Hello-

    Thanks for the inquiry. I've been looking at the custom solution our colleague created for you previously. It looks like it needs adjustments since Google seems to have changed its map API. I haven't yet had a chance to explore it yet. I'll will check back early next week. We apologize for the inconvenience.

  • Profile Image
    JotForm Support

    Answered by steve on September 30, 2014 at 05:56 PM

    Hello-

    I think I just figured it out. We need to specify the version of Google API we're using. Please update the topmost script tag to the following:

    <script type="text/javascript" src="//maps.google.com/maps/api/js?key=AIzaSyDY0kkJiTPVd2U7aTOAwhc9ySH6oHxOIYM&sensor=true&v=3" />

     

    For reference here's where I found the resolution:

    http://stackoverflow.com/questions/25505754/google-maps-and-richfaces-3-3-3-prototype-js-1-6-0-3-possible-incompatibility

    Please let us know if this resolves your issue. Also note, I set the default view to HYBRID, which shows the topography of the ocean floor.

    You can find a working version here:

    http://jsfiddle.net/5ytkx/144/

     

  • Profile Image
    JotForm Support

    Answered by steve on September 30, 2014 at 06:01 PM

    Here's a better version of the sample code: http://jsfiddle.net/5ytkx/145/

  • Profile Image

    Answered by COREVI on October 04, 2014 at 12:19 PM

    Thank you so much for your help. I just copied the new code onto my website, but the map is just sitting awkwardly on top of my form, rather than in the form field where it should be. Also the hidden sections seem to be showing. I'll go back to the original version and see if I can work it out, but I wanted to share that. If somebody is looking at this withing the next few minutes it will still be on the wrong version, but then I'll put it back to the old one without the controls until I or someone else fixes it.

     

    EDIT - I took the top script from the first working code and that seems to have worked. I only copied the first script code and left the rest of the form alone.

    In the future I'd love to

    see if we could add one of those little arrows you press to zoom in on your current location, but right now I'm just happy something is working again.
  • Profile Image

    Answered by Shadae on October 04, 2014 at 04:29 PM

    Hi Corevi,

    On behalf of my colleague, we are happy to hear that the issue is resolved!

    To confirm Google Maps is now giving you the desired results in your form?

  • Profile Image
    JotForm Support

    Answered by steve on October 04, 2014 at 04:54 PM

    Hello-

    Yes, I realized after posted that that I had included a debug version of the code. Glad you figured it out.

    The only other change you might also want is to update the default view to HYBRID. It's the only one that shows the terrain of the ocean floor, I believe.

    mapTypeId:google.maps.MapTypeId.ROADMAP


    update to this, if you like:

    mapTypeId: google.maps.MapTypeId.HYBRID

    You'll find a list of all the options here:
    https://developers.google.com/maps/documentation/javascript/maptypes#MapTypes

    I created a new thread for your other request to add one of those arrows you press to zoom in on your current location. We'll investigate if we can set that up.

    http://www.jotform.com/answers/438721

  • Profile Image

    Answered by COREVI on January 05, 2015 at 03:44 PM

    Hello, my map is broken again. For some reason the controls disappeared on the map, so I went back to this thread and found the source of the fix and tried to do it on my own. I now have a completely f***** form. I honestly don't even know where to ask for help. Could somebody PLEASE look at my code and see where I messed up? The live form is www.corevi.org/submit.html 

  • Profile Image

    Answered by Shadae on January 05, 2015 at 04:02 PM

    Hi COREVI,

    It appears that a part of your code has been cut off during your efforts to copy and paste it. It is not possible to copy and paste that much code in our forums as it may cause it to be cut off as well as it makes it unreadable.

    Can you please upload your code to pastebin.com and provide us with the link to it so that we are able to take a look at the issue.

    As the code that was provided is cut off, I have removed it from your post to maintain readability of the thread.

    Thank you.

  • Profile Image

    Answered by COREVI on January 05, 2015 at 04:05 PM

    Thanks, I am copying the code now. I have a meeting in 55 minutes with the people who use this form so I hope to get it working!

  • Profile Image

    Answered by COREVI on January 05, 2015 at 04:07 PM

    http://pastebin.com/7K5qWWzd

  • Profile Image

    Answered by Ben on January 05, 2015 at 04:39 PM

    Hi,

    Thank you for the link.

    Upon looking it seems that you had removed the ID which is used to find the element where the map should be:

    <div>
      Mark your DIVE LOCATION on the map!
      <div style="width:100%;height:527px;background:#5A8E4A;">
       Map
      </div>
    </div>

    should be:

    <div>Mark your DIVE LOCATION on the map!
    <div id="googleMap" style="width:100%;height:527px;background:#5A8E4A;">Map</div>
    </div>

    You can see and copy the code from here: http://pastebin.com/DxkwkpRa

    Do let us know if you have any further questions.

    Best Regards,
    Ben

  • Profile Image

    Answered by COREVI on January 05, 2015 at 04:43 PM

    Thank you! The only problem (related to this thread) is that the controls aren't showing. Do you know the code to add those in?

  • Profile Image

    Answered by Ben on January 05, 2015 at 05:19 PM

    Hi,

    You are welcome.

    Unfortunately I was not able to find the reason why the controls are not shown. I am not that familiar with Google Maps so that might require some time to find although I have check several forum posts and tried to fix it through CSS, which did not seem to work. The same was with the following js options:

    disableDefaultUI: false,
    panControl: true,
    scaleControl: true,
    zoomControl: true,
    zoomControlOptions: google.maps.ZoomControlStyle.SMALL

    I have also tried including v=3 in the URL of the script and setting the sensor to false, but as mentioned, it did not seem to work.

    If we find anything that would work, we will update you through this thread.

    Best Regards,
    Ben

  • Profile Image

    Answered by COREVI on January 06, 2015 at 08:00 AM

    I've been playing with it and I can't find anything that works. I'm working with a large range of user groups and many of them don't know how to zoom without the controls so getting this fixed is VERY important. Please let me know as soon as anything is discovered.

  • Profile Image

    Answered by Ben on January 06, 2015 at 09:24 AM

    Hi,

    We will update you if we find any updates through the other thread opened in regards to this (http://www.jotform.com/answers/438721), however as this is a full source code implementation with a bit complex modification we can not offer you the same support as if you are using our widgets through unmodified jotform.

    Having that said we will still update you in case we end up finding something that would work, but as mentioned due to the complexity and it being source code implementation we can not give it the same priority as if you were using the unmodified jotform.

    Best Regards,
    Ben