Created
February 20, 2012 06:56
-
-
Save alperdincer/1868186 to your computer and use it in GitHub Desktop.
Leaflet and Wax on Multiple Layer Interaction problem with IE 7 and 8
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
var MKN = {}; | |
MKN.Globals = {}; | |
MKN.Map.startMapping = function () { | |
var baseMapJson = { | |
tilejson: '1.0.0', | |
scheme: 'xyz', | |
tiles: ['http://10.211.55.2/_temp_service/tiles/basemap/{z}/{x}/{y}.png'] | |
}; | |
var serviceLayerXJson = { | |
tilejson: '1.0.0', | |
scheme: 'xyz', | |
tiles: ['http://10.211.55.2/_temp_service/tiles/serviceLayerX/{z}/{x}/{y}.png'], | |
grids: ['http://10.211.55.2/_temp_service/grids/serviceLayerX/{z}/{x}/{y}.json'], | |
formatter: MKN.Map.showserviceLayerXTooltip | |
}; | |
var serviceLayerYJson = { | |
tilejson: '1.0.0', | |
scheme: 'xyz', | |
tiles: ['http://10.211.55.2/_temp_service/tiles/serviceLayerY/{z}/{x}/{y}.png'], | |
grids: ['http://10.211.55.2/_temp_service/grids/serviceLayerY/{z}/{x}/{y}.json'], | |
formatter: MKN.Map.showserviceLayerYTooltip | |
}; | |
var ilJson = { | |
tilejson: '1.0.0', | |
scheme: 'xyz', | |
tiles: ['http://10.211.55.2/_temp_service/tiles/serviceLayerZ/{z}/{x}/{y}.png'], | |
grids: ['http://10.211.55.2/_temp_service/grids/serviceLayerz/{z}/{x}/{y}.json'], | |
formatter: MKN.Map.showserviceLayerZTooltip | |
}; | |
var baseMapLayer = new wax.leaf.connector(baseMapJson); | |
MKN.Globals.serviceLayerXLayer = new wax.leaf.connector(serviceLayerXJson); | |
MKN.Globals.serviceLayerYLayer = new wax.leaf.connector(serviceLayerYJson); | |
MKN.Globals.serviceLayerZLayer = new wax.leaf.connector(serviceLayerZJson); | |
MKN.Globals.mapObj = new L.Map('map_canvas', {center: new L.LatLng(38.7626503383, 35.936279296), zoom: 6, layers: [baseMapLayer], minZoom: 5, maxZoom: 13}); | |
var infobox = new L.Control.InfoBox(); //sample div component to show tooltips on map | |
MKN.Globals.mapObj.addControl(infobox); | |
wax.leaf.interaction(MKN.Globals.mapObj, serviceLayerXJson); | |
wax.leaf.interaction(MKN.Globals.mapObj, serviceLayerYJson); | |
wax.leaf.interaction(MKN.Globals.mapObj, serviceLayerZJson); | |
} | |
MKN.Map.showserviceLayerXTooltip = function (options, data) { | |
var elem = document.getElementById('tooltip_serviceLayerX'); | |
elem.innerHTML = '<b>X Name :</b> ' + data.name; | |
}; | |
MKN.Map.showserviceLayerYTooltip = function (options, data) { | |
var elem = document.getElementById('tooltip_serviceLayerY'); | |
elem.innerHTML = '<b>Y Name :</b> ' + data.name; | |
}; | |
MKN.Map.showserviceLayerZTooltip = function (options, data) { | |
var elem = document.getElementById('tooltip_serviceLayerZ'); | |
elem.innerHTML = '<b>Z Name :</b> ' + data.name; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment