Change the Marker based on Temperature - dictionary

I have a sample fusion table map here http://jsfiddle.net/qEGpz/
I want to set the marker to red_stars based on temperature >75 degree. But my code doesn't work correctly. Link to my fusion table is here https://www.google.com/fusiontables/DataSource?snapid=S567077W7iF Anyone please help. Thank you in advance.
With regards,
Pradeep Shankar M

Your example seems to be working fine. What is the problem? Note: the red_stars icon is fairly subtle. Looks like a standard Google Maps red marker with a black center star vs. black center circle.
Here's the list of the allowed Fusion Table iconNames. Choose Visualize -> Map to see what they look like. Perhaps you need to use "capital_small_highlight".
Took another look and another guess as what your problem is. Try this:
layer8 = new google.maps.FusionTablesLayer({
query: {
select: 'Geometry',
from: '4080901',
where: "Temp >= 75"
},
styles: [ {
where: "Temp >= '75'",
markerOptions: {
iconName: "red_stars",
}
}]
});
layer8.setMap(map);

Related

How can I use arrows option in HERE polyline?

I'm Juyeong.
I want use arrows option in polyline.
I found need setting map engine p2d for use arrows option in document.
But there didn't show how setting map engine.
I try use arrows option, but failed.
var style = function(feature){
var areaLightGrade = feature.data.area_light_grade;
feature.setStyle({
strokeColor: '#ffffffff',
fillColor: chooseLightGradeColor(areaLightGrade),
lineWidth: 1
});
};
// Create reader object initializing it with a document:
var reader = new H.data.geojson.Reader('http://127.0.0.1:8887/area_20180707.geojson', {style: style, disableLegacyMode: true});
Could you please tell me how can I use arrows option?
I'll looking forward your reply.
Thanks.
I found what is wrong.
I didn't set "disableLegacyMode" option.
When set that option, multipolygon did working.

openlayers mouse position problem with css transform:scale()

I need to scale my Openlayer layer map in order to display full map [ fit to screen ] while print preview is set [ A4, A3 ... A0 page setup ]. Now after apply the css transform : scale() to the map div the mouse over position is not working properly.
I found a issues in but didn't found any solution.
ol issues #5747
Any suggestion?
I had the same problem. But my situation was on "click query" and it goes to offset.
My solution is as follows. Hope it a little help.
var px = evt.pixel[0]/0.8;
var py = evt.pixel[1]/0.8;
var geoPt = map.getCoordinateFromPixel([px,py]);
var x = geoPt[0];
var y = geoPt[1];

add a tooltip to 2graph vis.js library

I am using a 2d line graph of vis.js (http://visjs.org/graph2d_examples.html ). Is there any way to add a tooltip to the data points so that when you mouse over or click you see the value in a pop up or somewhere else?
This is a feature they plan on adding.. the closest thing I see is this comment on trying to tackle the issue themselves:
https://github.com/almende/vis/issues/282#issuecomment-65728474
This solution is rather simpe:
Add label to points, eg.
var point = {
x: ...,
y: ...,
label: {
content: POINT_LABEL
}
};
points.push(point);
var dataset = new vis.DataSet(points);
Reference:
https://github.com/almende/vis/issues/282#issuecomment-217528166

Openseadragon image cordinates

iam doing a project using openseadragon check out the below example.
a samle openseadragon image
In the Onclick method want to find the cordinates(px,py) of the image.Is there any method?? please help this is ma first openseadragon project.
thanks
When you get a click, it'll be in window pixel coordinates. You can then translate it into viewport coordinates (which go from 0.0 on the left to 1.0 on the right). You can then translate those into image coordinates. Here's how it would look all together:
viewer.addHandler('canvas-click', function(event) {
var viewportPoint = viewer.viewport.pointFromPixel(event.position);
var imagePoint = viewer.viewport.viewportToImageCoordinates(viewportPoint.x, viewportPoint.y);
  console.log(imagePoint.x, imagePoint.y);
});
For more info on the coordinate systems, see: http://openseadragon.github.io/examples/viewport-coordinates/
The following code, adapted from #iangilman's answer, worked for me with OpenSeadragon 2.0.0. It seems that the second argument of the handler function got removed in more recent versions. I added the quick === true condition to keep it from firing on a drag start. It might also be a good idea to switch of the default single-click-to-zoom behaviour in the gestureSettingsMouse object.
viewer = OpenSeadragon({
id: "osd1",
prefixUrl: "/path/to/seadragon/images/",
tileSources: "/path/to/tif/images/image.tif.dzi",
showNavigator: true,
gestureSettingsMouse: {
clickToZoom: false,
dblClickToZoom: true
}
});
viewer.addHandler('canvas-click', function(target) {
if(target.quick === true){
var viewportPoint = viewer.viewport.pointFromPixel(target.position);
var imagePoint = viewer.viewport.viewportToImageCoordinates(viewportPoint.x, viewportPoint.y);
console.log(parseInt(imagePoint.x), parseInt(imagePoint.y));
}
});

how to select feature by drawing a line in openlayers?

There is one option in openlayers selecting features under the box. But, I want to select the features when I draw line (draw with shift key down-free hand drawing). In my script I already implemented drawing and selecting options. I can draw line and select (multiple) features independently. Now, I want to merge this two. I want to select those features data which are touched by my drawn line. Is there any sample example available?
Here, I have given sample code -
//Selection property---------------------------------------
var selectControl = new OpenLayers.Control.SelectFeature(
[vectorLayer],
{
clickout: true, toggle: true,
multiple: true, hover: false,
toggleKey: "ctrlKey", // ctrl key removes from selection
multipleKey: "shiftKey" // shift key adds to selection
}
);
map.addControl(selectControl);
selectControl.activate();
var draw = new OpenLayers.Control.DrawFeature(
vectorLayer, OpenLayers.Handler.Path,
{displayClass: "olControlDrawFeaturePoint", title: "Draw Features", handlerOptions: {holeModifier: "altKey"}}
);
Thanks, in advance.
You have to register event "sketchcomplete" that will run over all features in layer-bo-be-selected and check if it has shared geometry with line sketched.
Something like this, unfortunately I can't test it now.
vectorLayer.events.register('sketchcomplete', vectorLayer, sketchCompleteFunc);
function sketchCompleteFunc(obj) {
for (var i=0;i<layer-to-be-selected.features.length;i++) {
if (layer-to-be-selected.features[i].geometry.intersects(obj.geometry)) {
selectControl.select(layer-to-be-selected.features[i])
}
}
}

Resources