Hello,
I was able to get the SetEditMode(‘Rectangle’) to work well it is just not displaying a tracking rectangle. We want to have it display similarly to holding SHIFT and dragging to zoom in. I’ve explored several examples of using SetEditMode(‘Rectange’) and I’ve been replicate an example and it displays a tracking rectangle. Here is a little clip of what I am talking about. First map is the one not displaying the track and the second map is a example I replicated screencast.com/t/GipWGTpVp.
Thanks,
Neil
SetEditMode works but does not display a shape
Hi Neil,
So, I guess you want to disable the draw mode and still make it zoom in during holding on shift key. Currently, I didn’t figure out a way to implement it but I am searching for a solution in OpenLayers API and hope I will be lucky. Just want you know, in client side, we are using the openlayer’s library as the client side map engine and the drawControl is charge for drawing rectangle.
I will update here once any updates.
Thanks,
Troy
Hi Troy,
Thanks for replying. I’ll look into the drawControl and see if that can help. I may have been a little bit confusing. We are using the tracking feature to select items with the TrackEnded Event server side. We want the selecting of the items to be similar to the shift and zoom of simply displaying the rectangle. We have everything else working, just not the displaying of the rectangle. Please let me know if you can think of anything else.
Thanks,
Neil
Hi Neil,
In case there is any thing misunderstanding, what I am practicing is on the OpenLayer DrawFeature sample, and selected on “Draw Box” selection. Then, hold the shift button and draw a rectangle on the map to make it zoom in. But, unfortunately, I still didn’t make it work.
Here is the sample: dev.openlayers.org/examples/draw-feature.html
Thanks,
Troy
Hi Troy,
I’ve tried out that sample and it still didn’t work in our project. I created a simple project on the side and the sample worked in there. I then put that simple project into our main project and it didn’t work. I don’t know if it is with the ThinkGeo control or with our ASP.net template. We were thinking it could be something were we need to override the templates css and see if that works. If you have an possible suggestions I would appreciate it greatly. I know that the drawing of the zoom box with SHIFT + Click and drag displays properly. Is there any way to replicate that outside creating a new vector layer?
Thanks again,
Neil
Neil,
May I know what’s your simple project, is it the draw-feature sample from Openlayers? I guess I may lost the context of this thread.
For replicate creating a new vector layer outside, do you mean creating a vector layer without ThinkGeo? If yes, then I think so, we can create vector layer with Openlayer APIs. If no, hope you can give us more details about your questions.
Thanks,
Troy
Hi Troy,
I’m sorry for any confusion.
The simple project I created was a basic ThinkGeo map and on the client side inputted the code for dev.openlayers.org/examples/draw-feature.html and it worked great. Once I put that code into our ASP.net project the objects I attempted to create wouldn’t display. We are guessing it could have something to do with our CSS template and we are exploring that possibility.
So to revise my question, we are having the user create a feature for selecting by an area on the map (we delete the feature in the code behind). We have all the selecting code working fine and only need the object to display as they are creating it. Though the attempts for using SetEditMode and OpenLayers are not working I noticed that the Zooming function with Shift + Click and drag displays a rectangle. We want to mimic displaying that rectangle but for the purposes of selecting. Is this possible to do without using OpenLayers or SetEditMode (since these two are not working on our project)?
Let me know if this explains it well enough.
Thank you,
Neil
Hi Neil,
Thanks for the clarification, I get your issue now.
In my opinions, the most suspicious part is the theme folder. So, would you please delete the "theme" folder and then run your application again? Or, you can replace the folder content with the same folder content from the basic ThinkGeo sample. The theme folder is only generated when the map page load first time.
If the issue persists, would you mind to send us a sample simulate your project or your project directly? Also, you can publish your website then we can debug it online.
Thanks,
Troy
Hi Troy,
Thank you for the references to the css files. I explored the issue further and found that it was the code in our project. We had a local styling for svg’s width that was overriding the svg default width. This consequently cause the shapes created not to display. After overriding our local svg styling the object displayed properly.
Thanks again Troy for the help,
Neil
Hi Neil,
We are glad to hear that solved.
Any question please let us know.
Regards,
Don