Can I show VE toolbar through Map suite web edition control?
Also I am looking to display VE zoom level number details on Map (VE has 1-20 zoom level). I want to display this number to label on MAP
Map Suite Web and Virtual Earth
Hi Lyle,
Although the VE toolbar can show through Map Suite web edition control, but its behavior is prevented by OpenLayers, so that you can’t navigate the map by VE’s toolbar currently.
The following JavaScript indicates how to turn VE’s toolbar on and alert current ZoomLevel.
var OnMapCreated = function(map) {
// Display the toolbar of VE, but it can't work.
var layer = map.getLayer("VirtualEarth Map");
if (layer != null) {
layer.mapObject.ShowDashboard();
}
// Alert Current Zoomlevel.
map.events.register('zoomend', map, function(e) {
alert(map.getZoom() + 1);
});
}
If you have any questions please let me know.
Thanks
Howard
Hi Howard,
Is there any way to enable virtual earth dashboard? Or do you have any web based dashboard sample (like VE dashboard) that controls navigation. Basically I need custom dashboard navigation like Virtual earth to be displayed on top of Web Suite web edition map control.
Thanks
Hiren
Hiren,
We can’t make the default VE dashboard works; for VE layer’s operations such as zooming in/out is covered by OpenLayers, but we support client APIs which can implement your own Dashboard.
For example, the key functions of the Dashboard are Panning, Zooming In/Out, and Zooming to a specify Level, and Switching BaseOverlays.
The following list specifies how to implement them with JavaScript.
1. Pan to Any Direction: Please add the following script to the header tag of your ASPX page, and refer to our installed sample under “\Samples\NavigateTheMap\PanTheMap.aspx” for detail.
function panOffset(x, y) {
var newX = Map1.GetCenter().lon + x;
var newY = Map1.GetCenter().lat + y;
Map1.PanToWorldCoordinate(newX, newY);
}
2. Zoom In/Out:
Map1.ZoomIn();
Map1.ZoomOut();
Please refer to our installed sample under “\Samples\NavigateTheMap\ZoomInAndOut.aspx” for detail.
3. Zoom To an Specify level:
Map1.GetOpenLayersMap().moveTo(lonLat, zoomLevel);
4. Switch BaseOverlay:
Map1.SetBaseLayer(overlayId);
With these functions above, the rest work is to implement the interface of the Dashboard.
Any questions please let me know,
Thanks,
Howard
Howard,
I have VE as background with multiple shape layers on top of it (poly lines, lines etc).
Whenever I zoom in poly lines becomes blurred while zooming is in progress, and it gets normal when zooming done.
Is there any way to avoid this blurring lines during zooming in process.
Thanks
Hiren
Hi Hiren,
This issue is caused by the default animation of Virtual Earth, such as the matching accuracy between Overlays etc. So we cut this feature in the upcoming version.
function OnMapCreated(map) {
var ve = map.getLayer("VirtualEarth Map");
ve.mapObject.vemapcontrol.SetAnimationEnabled(false);
}
Any questions please let me know,
Thanks,
Howard
Hi Howard,
I already have above java script, still blurring of poly lines during zooming process not resolved. But it did resolved my other issue with panning earlier. When you pane, VE and over laid layers where not coming together at same time.
Is there any other way or trick to avoid bluring lines during zooming in process?
Thanks
Hiren
Hi Howard,
I have couple of question continuing to Virtual Earth as back ground with multiple shape files that includes poly lines and points.
1. How do I display value from multiple columns (concatenation) to label?
2. Can I size point symbol programmatically at different zoom level?
Lets say, display point size 8f when zoom level is between 14-16 and display size as 12f when zoom level is > 16
3. There are 10 .shp layers (poly lines and points) drawn on top of VE, first how do I find which layer user clicked on the map? Based on user selected layer, I want to find out selected layer type as ‘points’ or ‘poly lines’ and show attributes to user in pop up window.
Note: All layers are .shp files and has attributes, but I need to display attributes only for user selected
4. I can draw ‘points’ or ‘poly lines’ at certain zoom level. But can I show its associated labels later at different zoom level? For ex. I displayed points layer at zoom level = 15, but want to show it’s label at zoom level = 18
5. Also blurring of lines does not resolved when user panning across map
Hiren
Hiren,
I’m not quite clear about blurring of polylines during zooming process. Zooming process means animation of zooming? Could you show me a screenshot of this issue?
Here are the answers for the questions you asked.
1. Only one column can rendered as label on the map by TextStyle. The following script indicates how to render “STATE_NAME” column of layer on the map.
layer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.City1("STATE_NAME");
2. You can set different style for different ZoomLevels. Please see the following code.
pointLayer.ZoomLevelSet.ZoomLevel14.DefaultPointStyle = PointStyles.CreateSimplePointStyle(PointSymbolType.Circle, GeoColor.SimpleColors.Red, 8f);
pointLayer.ZoomLevelSet.ZoomLevel14.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level16;
pointLayer.ZoomLevelSet.ZoomLevel17.DefaultPointStyle = PointStyles.CreateSimplePointStyle(PointSymbolType.Circle, GeoColor.SimpleColors.Red, 12f);
pointLayer.ZoomLevelSet.ZoomLevel17.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
3. My method is looping through all the layers, check whether the click point is on a feature of a layer or not, if yes, that’s the layer you want. Here is a method to help you this.
private ShapeFileFeatureLayer GetClickedLayer(Collection<ShapeFileFeatureLayer> layers, PointShape clickPoint)
{
ShapeFileFeatureLayer returnLayer = null;
foreach (ShapeFileFeatureLayer layer in layers)
{
Collection<Feature> features = layer.QueryTools.GetFeaturesContaining(clickPoint, ReturningColumnsType.AllColumns);
if (features.Count != 0)
{
returnLayer = layer;
break;
}
}
return returnLayer;
}
4. You can set another style for the ZoomLevel18 which contains both PointStyle and TextStyle.
pointLayer.ZoomLevelSet.ZoomLevel15.DefaultPointStyle = PointStyles.CreateSimplePointStyle(PointSymbolType.Circle, GeoColor.SimpleColors.Red, 8f);
pointLayer.ZoomLevelSet.ZoomLevel15.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level17;
pointLayer.ZoomLevelSet.ZoomLevel18.DefaultPointStyle = PointStyles.CreateSimplePointStyle(PointSymbolType.Circle, GeoColor.SimpleColors.Red, 8f);
pointLayer.ZoomLevelSet.ZoomLevel18.DefaultTextStyle = TextStyles.City1("COLUMN_NAME");
pointLayer.ZoomLevelSet.ZoomLevel18.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
5. Could you provide us more information about the blurring such as screenshot? We can’t recreate your issue.
Any questions please let me known.
Thanks,
Howard
Hi Howard,
Attached is screen shot for blurring issue.
It has 3 screen shots, before zooming in, while zooming in process and after zoomed in.
Refereing to question 3 earlier,
User may clicked any layer (it could be polylines or points layer) to get an attributes information out of 10 layers.
layer.QueryTools.GetFeaturesContaining does not work with polylines type layer. How do I find layer type to
determine, as 'Points' or 'Poly lines' and which querytools methods should use for polylins and points layers.
Currently I am using layer.QueryTools.GetFeaturesNearestTo for one of polylines layers. It works fine when user
clicks on that polylines and it shows attributes in pop up window. But it also shows attributes when user clicks
far away from that layer. How do I avoid this?
I am displaying attributes on Map1_clicked event, that shows attributes but it also zoomes in.
How do I stop zooming in map, when user want to see attributes of selected layer?
Thanks
Hiren
677-Polylines_Blurring-Before.JPG (131 KB)
679-Polylines_Blurring-After_zoomed.JPG (101 KB)
Hiren,
When you click on the map, buffer the clicked point to a MulipolygonShape, and check whether the shape which you are click at and the MulipolygonShape are Intersected. Here is the sample code for you.shapeLayer.QueryTools.GetFeaturesIntersecting(clickedPolygon, ReturningColumnsType.NoColumns);
Also, I can’t find the screenshot, if the attached file is too big, please send it to support@thinkgeo.com and ask to forward to Howard.
Any questions please let me know.
Thanks,
Howard
Howard,
Please find attached screen shots for blurring lines issue. I'm also sending to support@thinkgeo.com and asking them to forward you.
Thanks
Hiren
677-Polylines_Blurring-Before.JPG (131 KB)
679-Polylines_Blurring-After_zoomed.JPG (101 KB)
692-Polylines_Blurring-Zooming_in_process.JPG (95 KB)
Howard,
Is map suite web edition compatible with all browser?
It works absoultely fine with Firefox, but it fails in performance and other aspects when use in Internet Explorer
We are using IE 6.0 (officially fire fox is not allowed)
Please find attached screenshots of issue in IE
1. In IE.GIF - OverlaySwitcher shows extra blue panel on back
2. IE-2.GIF - While zooming in creates single 'blue square/rectagnle' or some time multiple across the map.
3. IE-3_Blurring issue.GIF - Blurring issue is also continues here with IE as well, with big blue sqare box. I dont know why it always draws blue box on it's own
4. IE-4_switch to Google map.GIF - Error 'This.mp is null or not object' always popups when I switch from Virtual earth to google
5. IE-4_switch to Yahoo map.GIF - Error 'Null is null or not an obhect' always popups when I switch from google to yahoo or vice versa.
Is this is bug with web control? I'm planning to create some prototype demo this Thursday to my director.
I was not allowed to upload rest of 2 images because of size limit?
Thanks
Hiren
690-IE-2.GIF (128 KB)
691-IE-3_Blurring_issue.GIF (65.1 KB)
686-IE.GIF (97.5 KB)
Hi Hiren,
I see, you want to disable the stretch effect. We have an API to turn off it in LayerOverlay which contains your line layers. Please see the code below.
lineOverlay.TransitionEffect = TransitionEffect.None;
Map Suite Web Edition works fine in IE6, IE7, as well as firefox; IE8 has some issue about drawing and editing in standard mode. we didn’t recreate your issue in IE6.
We have an installed sample under “\Samples\Overlays\UseGoogleYahooWms.aspx”, it’s simular like your senario. Could you please access this sample on your machine and check whether the issue still exists?
We really want a prototype demo to help us recreate your issue, please send it to support@thinkgeo.com and ask them to forward to me. If it’s a bug, we’ll fix it immediately.
Thanks for reporting, and if you have any questions please let me know.
Thanks,
Howard
Howard,
Stretching of poly lines resolved.
But I have other question.
I have multiple layers (poly lines and points - total 15 layers) on VE using custom over layers. Some of lines and points layers are over lapped to each other which is hardly visible to users. So user want to see attributes by highlighting those multiple layers (high light using mouse by creating sqaure/ rectangle area), and it should return attributes out of shape files for all the layers that falls in highlight area.
Once I get attributes for multiple layers, I want to display it in list box.
Thanks
Hiren
Hiren,
You can accomplish it by the following steps.
1, whenever the user highlight a rectangle area, get that rectangle in World Coordinate, and get the width/height in Screen Coordinate. The class ExtentHelper can help you converting from one coordinate to the other.
2, Draw the features within the highlight area to a bitmap. You can use the Draw() method of the LayerOverlay, which you've added all the 15 layers to. The code will be similar like this:GdiPlusGeoCanvas gdiPlusGeoCanvas = new GdiPlusGeoCanvas();
Bitmap bitMap = new Bitmap(width, height);
featureOverlay.Draw(gdiPlusGeoCanvas, bitMap, highlightedExtent, GeographyUnit.DecimalDegree);
Now we've drawn all the highlighted features on that bitMap.
3, Draw that bitmap on top of the right place on the map. You can either fill it to a div on client or draw it using a custom layer (inheriting a Layer and override the DrawCore method) on server if you want.
Let me know if you have any issues.
Thanks,
Howard
Howard,
I think I did not make it clear.
There are multiple layers on the map; some of them are over lapped to each other. User wants to see attributes of each overlapped layer.
How do I allow user to select multiple layers on map?
(Can I display attributes of overlapped layers by mouse hover on it? If it’s multiple, it should show attributes for each layer separately)
How do I retrieve/show attributes of each selected layers from above action?
Thanks
Hiren
Hiren,
We have a sample to show the tooltips when mouse hovering.
You need through all the layers which are overlapped to each other and find the features you needed from these layers. Send the information back to client and display theme with JavaScript. Hope it helps.
If you have any questions please let me know.
Thanks,
Howard
713-Post5706_Tooltips.zip (99.3 KB)
Howard,
Attached sample solution is not working.
When I open solution, it did not open content.
In Default.aspx on line 9 - I get some CSS errors. 'filter' is not known CSS protery name
When I run solution it shows Map but does nothing on hovering.
Am I missing something.
Thanks
Hiren
Hi Hiren,
Are you using our latest version 3.1.124 or 3.1.16? If you are using 3.1.124, please remove the following script in the Default.aspx which use for working around a bug in 3.1.16.
// to work around tooltip bug in 3.1.16
var postData = decodeURIComponent(__theFormPostData);
var startData = postData.substr(0, postData.indexOf('&'));
var endData = postData.substr(postData.indexOf('&'), postData.length - postData.indexOf('&'));
__theFormPostData = startData + ',' + map.getScale().toString() + endData;
If the issue still exists, please provide me more information such as Web Browser, OS, etc. On the other hand, it’s a idea for you using callback.
If you have any questions please let me know.
Thanks,
Howard