- Posts: 3
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Satellite map
- prady
- Topic Author
- Offline
- New Member
Less
More
12 years 9 months ago - 12 years 9 months ago #62753
by prady
Satellite map was created by prady
Hi, I'm trying to set up the mapping service to display a satellite or hybrid view... can anybody help me?
Thanks in advance!
Nicola
Thanks in advance!
Nicola
Last edit: 12 years 9 months ago by prady.
The topic has been locked.
- prady
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
12 years 9 months ago - 12 years 9 months ago #62822
by prady
Replied by prady on topic Satellite map [SOLVED]
Solved:
In survey_runtime.js
I added this string:
map.setMapType(G_HYBRID_MAP);
after this one
var map = new GMap2(document.getElementById("gmap_canvas_" + question));
In survey_runtime.js
I added this string:
map.setMapType(G_HYBRID_MAP);
after this one
var map = new GMap2(document.getElementById("gmap_canvas_" + question));
Last edit: 12 years 9 months ago by prady.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
12 years 9 months ago #62823
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Satellite map
You can add map controls or set the default map type in scripts/survey_runtime.js.
Find this line:
And insert this line after it:
To set the default map type, add this line next:
The most common map types are:
- G_NORMAL_MAP displays the default road map view.
- G_SATELLITE_MAP displays Google Earth satellite images.
- G_HYBRID_MAP displays a mixture of normal and satellite views.
- G_PHYSICAL_MAP displays a physical map based on terrain information.
Find this line:
Code:
map.addControl(new GSmallMapControl());
And insert this line after it:
Code:
map.addControl(new GMapTypeControl());
To set the default map type, add this line next:
Code:
map.setMapType(G_SATELLITE_MAP);
The most common map types are:
- G_NORMAL_MAP displays the default road map view.
- G_SATELLITE_MAP displays Google Earth satellite images.
- G_HYBRID_MAP displays a mixture of normal and satellite views.
- G_PHYSICAL_MAP displays a physical map based on terrain information.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- prady
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
12 years 9 months ago #62826
by prady
Replied by prady on topic Satellite map
Thanks!!!
The topic has been locked.
- velvetmonster
- Offline
- New Member
Less
More
- Posts: 1
- Thank you received: 1
10 years 4 months ago #101906
by velvetmonster
Replied by velvetmonster on topic Satellite map
The code has changed.
Here is the current method for updating from ROADMAP to HYBRID:
Change this:
mapTypeId: google.maps.MapTypeId.ROADMAP
to this:
mapTypeId: google.maps.MapTypeId.HYBRID
Here is the current method for updating from ROADMAP to HYBRID:
Change this:
mapTypeId: google.maps.MapTypeId.ROADMAP
to this:
mapTypeId: google.maps.MapTypeId.HYBRID
The topic has been locked.
- c_schmitz
- Offline
- LimeSurvey GmbH Employee
Less
More
- Posts: 301
- Thank you received: 84
9 years 2 months ago - 9 years 2 months ago #117073
by c_schmitz
Best regards
Carsten Schmitz
LimeSurvey project leader
Replied by c_schmitz on topic Satellite map
Unfortunately the solutions offered so far do require a change of the core files.
In case of a version update they will be gone, nor does everyone have the ability to change the core files by themselves.
The following codelines can be put into the template.js file (which can be edited by a normal LimeSurvey administrator) and adjusted as seen fit.
In this example the map type is set to hybrid. That way only the survey using the particular template is affected. Valid values are
HYBRID Displays a photographic map + roads and city names
ROADMAP Displays a normal, default 2D map
SATELLITE Displays a photographic map
TERRAIN Displays a map with mountains, rivers, etc.
In case of a version update they will be gone, nor does everyone have the ability to change the core files by themselves.
The following codelines can be put into the template.js file (which can be edited by a normal LimeSurvey administrator) and adjusted as seen fit.
Code:
$(document).ready(function(){ $.each(gmaps, function( mapid, map ) { if (mapid.indexOf("marker")==-1) map.setMapTypeId(google.maps.MapTypeId.HYBRID); }); });
In this example the map type is set to hybrid. That way only the survey using the particular template is affected. Valid values are
HYBRID Displays a photographic map + roads and city names
ROADMAP Displays a normal, default 2D map
SATELLITE Displays a photographic map
TERRAIN Displays a map with mountains, rivers, etc.
Best regards
Carsten Schmitz
LimeSurvey project leader
Last edit: 9 years 2 months ago by c_schmitz.
The following user(s) said Thank You: OMN
The topic has been locked.
- OMN
- Offline
- New Member
Less
More
- Posts: 1
- Thank you received: 0
9 years 2 months ago #117076
by OMN
Replied by OMN on topic Satellite map
Tested here, working perfectly. Thanks Schmitz.
Ouassim Manout
Ouassim Manout
The topic has been locked.