embedding gmap4
- geographics
- Posts: 963
- Joined: August 5th, 2010, 2:11 pm
embedding gmap4
.
Last edited by geographics on February 23rd, 2012, 11:11 pm, edited 1 time in total.
-
- Posts: 157
- Joined: September 3rd, 2010, 10:24 am
- Contact:
Re: embedding gmap4
Great suggestion.
But keep in mind that a Gmap4 map is 'live' and therefore does things in response to most kinds of clicks. For example, a double click will center the map at that spot.
If ph.org does allow Gmap4 to run in an iframe, then anyone viewing that embedded map can always get a URL that (when pasted into a browser bar) will open the map full screen. Simply click Menu ==> Show Map URL. Copy that URL and paste it into a browser bar.
Here's an example of a Gmap4 map embedded in a forum post. Unfortunately, the MyTopo tile server is down this morning and so the map is blank. Just click MyTopo and select a different map view.
http://www.whitneyzone.com/wz/ubbthread ... ip_15_mile
But keep in mind that a Gmap4 map is 'live' and therefore does things in response to most kinds of clicks. For example, a double click will center the map at that spot.
If ph.org does allow Gmap4 to run in an iframe, then anyone viewing that embedded map can always get a URL that (when pasted into a browser bar) will open the map full screen. Simply click Menu ==> Show Map URL. Copy that URL and paste it into a browser bar.
Here's an example of a Gmap4 map embedded in a forum post. Unfortunately, the MyTopo tile server is down this morning and so the map is blank. Just click MyTopo and select a different map view.
http://www.whitneyzone.com/wz/ubbthread ... ip_15_mile
Re: embedding gmap4
OK To do this the code is
Just change the URL to the URL of your Gmap. It will look like this:
[gmap]http://sites.google.com/site/gmap4files ... e.gpx&t=t2[/gmap]
Code: Select all
[gmap]http://sites.google.com/site/gmap4files/p/helpfile/Johnson_Ridge.gpx[/gmap]
[gmap]http://sites.google.com/site/gmap4files ... e.gpx&t=t2[/gmap]
-Dan
Site Tech Helper
Site Tech Helper
-
- Posts: 157
- Joined: September 3rd, 2010, 10:24 am
- Contact:
Re: embedding gmap4
Looks nice Dan. Thanks.
I tried adding the URL parameter &t=h to display the Google aerial but instead I still got the topo map in the preview pane.
[gmap]http://sites.google.com/site/gmap4files/p/helpfile/Johnson_Ridge.gpx&t=h[/gmap]
Gmap4 understands various URL parameters. In addition to the URL for a data file, is your code intended to also pass through any other URL parameters which the user has specified?
Also, consider the following URL. Note that the q parameter is empty. This URL starts Gmap4 and displays a symbol at Timberline Lodge. Think about threads where the topic is a certain spot. Often times much confusion can be eliminated if someone posts a map showing that spot. Is it possible for your code to accomodate maps of this sort?
http://www.mappingsupport.com/p/gmap4.php?q=&ll=45.331423,-121.711522&z=15&t=t2&symbol=pg
I tried adding the URL parameter &t=h to display the Google aerial but instead I still got the topo map in the preview pane.
[gmap]http://sites.google.com/site/gmap4files/p/helpfile/Johnson_Ridge.gpx&t=h[/gmap]
Gmap4 understands various URL parameters. In addition to the URL for a data file, is your code intended to also pass through any other URL parameters which the user has specified?
Also, consider the following URL. Note that the q parameter is empty. This URL starts Gmap4 and displays a symbol at Timberline Lodge. Think about threads where the topic is a certain spot. Often times much confusion can be eliminated if someone posts a map showing that spot. Is it possible for your code to accomodate maps of this sort?
http://www.mappingsupport.com/p/gmap4.php?q=&ll=45.331423,-121.711522&z=15&t=t2&symbol=pg
- geographics
- Posts: 963
- Joined: August 5th, 2010, 2:11 pm
Re: embedding gmap4
.
Last edited by geographics on February 23rd, 2012, 11:44 pm, edited 1 time in total.
-
- Posts: 157
- Joined: September 3rd, 2010, 10:24 am
- Contact:
Re: embedding gmap4
The file name for the production code is always: gmap4.php
This URL should be written:
http://www.mappingsupport.com/p/gmap4.php?ll=48.008,-88.872&t=t2&z=11
This URL should be written:
http://www.mappingsupport.com/p/gmap4.php?ll=48.008,-88.872&t=t2&z=11
- geographics
- Posts: 963
- Joined: August 5th, 2010, 2:11 pm
Re: embedding gmap4
.
Last edited by geographics on February 23rd, 2012, 11:40 pm, edited 1 time in total.
- geographics
- Posts: 963
- Joined: August 5th, 2010, 2:11 pm
Re: embedding gmap4
.
Last edited by geographics on February 23rd, 2012, 11:40 pm, edited 1 time in total.
Re: embedding gmap4
I changed it to gmap4 now instead of gmap.
It will accept a query string. Before I was just overriding the "t" field, but I think it was accepting other fields. I took away the default "t" setting.
I guess I kind of misunderstood what the original poster wanted to do. Maybe the specific one I set it up for isn't very useful?
The "http://www.mappingsupport.com/p/gmap4.p ... &symbol=pg" example is kind of tricky.
It would be a security risk to allow people to put a full URL in the iframe (like starting with http://www.mappingsuport.com), and PHPBB doesn't really have a setting for just the query string (the more specific ones don't allow ampersands or = signs I don't believe, the URL one has to start with http://). I could do it as straight text, but again it's an XSS security risk, albeit a rather obscure one that probably wouldn't get exploited.
I could set up one that would take just the latitude and longitude separated by a comma, but I'm not sure if that is advanced enough to do what you want. Like this:
To do this:
What do you think? Could you give me a good set of default options and we could run with that, or is not powerful enough?
It will accept a query string. Before I was just overriding the "t" field, but I think it was accepting other fields. I took away the default "t" setting.
I guess I kind of misunderstood what the original poster wanted to do. Maybe the specific one I set it up for isn't very useful?
The "http://www.mappingsupport.com/p/gmap4.p ... &symbol=pg" example is kind of tricky.
It would be a security risk to allow people to put a full URL in the iframe (like starting with http://www.mappingsuport.com), and PHPBB doesn't really have a setting for just the query string (the more specific ones don't allow ampersands or = signs I don't believe, the URL one has to start with http://). I could do it as straight text, but again it's an XSS security risk, albeit a rather obscure one that probably wouldn't get exploited.
I could set up one that would take just the latitude and longitude separated by a comma, but I'm not sure if that is advanced enough to do what you want. Like this:
Code: Select all
[latlon]45.331423,-121.711522[/latlon]
What do you think? Could you give me a good set of default options and we could run with that, or is not powerful enough?
-Dan
Site Tech Helper
Site Tech Helper
-
- Posts: 157
- Joined: September 3rd, 2010, 10:24 am
- Contact:
Re: embedding gmap4
Dan,
I think some other sites are editing the iframe entry against a white list of domain names. Only domain names on the white list are allowed to use iframes. Is that approach possible and would it satisfy your XSS concerns?
Gmap4 itself is hardened against XSS and the next update will screw things down even tighter.
I think some other sites are editing the iframe entry against a white list of domain names. Only domain names on the white list are allowed to use iframes. Is that approach possible and would it satisfy your XSS concerns?
Gmap4 itself is hardened against XSS and the next update will screw things down even tighter.