<script>
var map, local, layer, vectorLayer, vectorLayer1, drawPolygon, markerLayer, drawPoint, drawLine,
style = {
strokeColor: "#304DBE",
strokeWidth: 1,
pointerEvents: "visiblePainted",
fillColor: "#be1f29",
fillOpacity: 0.5
},
host = window.isLocal ? window.server : "http://support.supermap.com.cn:8090",
url= host+ "/iserver/services/map-world/rest/maps/World";
init();
function init() {
layer = new SuperMap.Layer.TiledDynamicRESTLayer("World", url, {
transparent: true,
cacheEnabled: true
}, {maxResolution: "auto"});
layer.events.on({"layerInitialized": addLayer});
vectorLayer = new SuperMap.Layer.Vector("Vector Layer");
vectorLayer1 = new SuperMap.Layer.Vector("Vector Layer1");
markerLayer = new SuperMap.Layer.Markers("Markers");
//几何圆查询
drawPolygon1 = new SuperMap.Control.DrawFeature(vectorLayer, SuperMap.Handler.RegularPolygon, {handlerOptions: {sides: 50}});
drawPolygon1.events.on({"featureadded": drawCompleted});
map = new SuperMap.Map("map", {
controls: [
new SuperMap.Control.ScaleLine(),
new SuperMap.Control.Zoom(),
new SuperMap.Control.Navigation({
dragPanOptions: {
enableKinetic: true
}
}),
drawPolygon1, drawPolygon2, drawPoint, drawLine, drawRectangle]
});
map.addControl(new SuperMap.Control.LayerSwitcher(), new SuperMap.Pixel(42, 80));
}
function addLayer() {
map.addLayers([layer, vectorLayer, vectorLayer1, markerLayer]);
map.setCenter(new SuperMap.LonLat(0, 0), 0);
}
function clearStatus() {
vectorLayer.removeAllFeatures();
vectorLayer1.removeAllFeatures();
markerLayer.clearMarkers();
}
我感觉是一共三个图层,然后怎么替换成我们自己发布的图层呢,是发布到超图iserver中我们图层的名字来替换此代码中的Markers,Vector吗