-
Notifications
You must be signed in to change notification settings - Fork 769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UTFGridWMS support #1076
Closed
Closed
UTFGridWMS support #1076
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
9496932
added utfgridwms support
fdesj 5a885f1
added example
fdesj 1f92cbd
changed map path
fdesj 334f3fe
changed lib path and text
fdesj a6cab62
removed layer switcher
fdesj 61abb55
added utfgridwms.js
fdesj 12b307a
added msgsoc.mapgears.com
fdesj ce53cf7
added working example
fdesj f69fc05
added utfgridwms support
fdesj b7d04cb
fixing single tile
fdesj 8f25552
fixed singleTile for utfgridwms
fdesj 36523d5
moved gridResolution to fix UTFGridWMS layer error
fdesj 5ffec59
working example
fdesj 23fa807
small change so both layer setting works
fdesj a3eb109
changed prxy path
fdesj af633bc
small text changes
fdesj 871a503
changed example text
fdesj 38714bc
removed console.log
fdesj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> | ||
<meta name="apple-mobile-web-app-capable" content="yes"> | ||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css"> | ||
<link rel="stylesheet" href="style.css" type="text/css"> | ||
<script src="../lib/OpenLayers.js"></script> | ||
<script type="text/javascript"> | ||
var lon = 0; | ||
var lat = 40; | ||
var zoom = 4; | ||
var control, callback; | ||
OpenLayers.ProxyHost = "./proxy.cgi?url="; | ||
|
||
init = function(){ | ||
var map = new OpenLayers.Map( 'map' ); | ||
var layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", | ||
"http://msgsoc.mapgears.com/cgi-bin/mapserv.cgi?map=/home/fdesjarlais/nemapfile/nemapfile.map&", {layers: 'basic,points'}, {isBaseLayer:true, singleTile:true} ); | ||
map.addLayer(layer); | ||
var layer2 = new OpenLayers.Layer.UTFGridWMS( "Utfgrid", | ||
"http://msgsoc.mapgears.com/cgi-bin/mapserv.cgi?map=/home/fdesjarlais/nemapfile/nemapfile.map&", {layers: 'basic'}, {utfgridResolution: 4, singleTile:true} ); | ||
map.addLayer(layer2); | ||
var layer3 = new OpenLayers.Layer.UTFGridWMS( "Utfgrid", | ||
"http://msgsoc.mapgears.com/cgi-bin/mapserv.cgi?map=/home/fdesjarlais/nemapfile/nemapfile.map&", {layers: 'points'}, {utfgridResolution: 4, singleTile:true} ); | ||
map.addLayer(layer3); | ||
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); | ||
map.addControls([new OpenLayers.Control.Scale(), new OpenLayers.Control.MousePosition()]); | ||
|
||
callback = function(infoLookup) { | ||
var msg = ""; | ||
if (infoLookup) { | ||
var layer, info; | ||
for (var idx in infoLookup) { | ||
layer = map.layers[idx]; | ||
info = infoLookup[idx]; | ||
if (info && info.data) { | ||
msg += "Feature ID: " + info.id + "<br>"; | ||
for (var key in info.data) { | ||
msg += key + ": " + info.data[key] + "<br>"; | ||
} | ||
} | ||
} | ||
} | ||
document.getElementById("attrs").innerHTML = msg; | ||
}; | ||
|
||
var controls = { | ||
move_country: new OpenLayers.Control.UTFGrid({ | ||
callback: callback, | ||
layers: [layer2], | ||
handlerMode: "move" | ||
}), | ||
move_city: new OpenLayers.Control.UTFGrid({ | ||
callback: callback, | ||
layers: [layer3], | ||
handlerMode: "move" | ||
}), | ||
move_both: new OpenLayers.Control.UTFGrid({ | ||
callback: callback, | ||
layers: [layer2,layer3], // same as all map.layers | ||
handlerMode: "move" | ||
}) | ||
}; | ||
for (var key in controls) { | ||
map.addControl(controls[key]); | ||
} | ||
|
||
toggleControl = function(el) { | ||
for (var c in controls) { | ||
controls[c].deactivate(); | ||
} | ||
controls[el.value].activate(); | ||
} | ||
toggleControl({value: "move_country"}); | ||
} | ||
</script> | ||
</head> | ||
<body onload="init()"> | ||
<h1 id="title">OpenLayers UTFGridWMS Demo</h1> | ||
|
||
<div id="tags"> | ||
wms, layer, singletile | ||
</div> | ||
<p id="shortdesc"> | ||
This page demonstrates the use of the OpenLayers UTFGridWMS. | ||
</p> | ||
|
||
<div id="map" class="smallmap"></div> | ||
<ul id="controlToggle"> | ||
<li> | ||
<input type="radio" name="type" value="move_country" id="moveHandler" | ||
onclick="toggleControl(this);" checked="checked" /> | ||
<label for="moveHandler">View country</label> | ||
</li> | ||
<li> | ||
<input type="radio" name="type" value="move_city" id="hoverHandler" | ||
onclick="toggleControl(this);" /> | ||
<label for="hoverHandler">View cities</label> | ||
</li> | ||
<li> | ||
<input type="radio" name="type" value="move_both" id="clickHandler" | ||
onclick="toggleControl(this);" /> | ||
<label for="clickHandler">View both</label> | ||
</li> | ||
</ul> | ||
<div id="docs"> | ||
<p><strong id="attrs"> </strong></p> | ||
<p> This exemple demostrates the use of UTFGridWMS. It allows high interaction maps with WMS. It can be used with the same functionalities that UTFGrid has.</p> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this isn't doing what you expect it to be doing.
I'd go with