I construct three polygons in the google map using the help polygons in google Map API for developers site. They are look like one polygon inside an another polygon .When my page is loaded all three polygon are loaded.How can i get the inner polygon when the outer polygon is zoomed or clicked in google map?Image:polygon inside another polygon
Your polygon are just place in postion that appear as one is inside another
for google maps the way you place your polygon had not a topological meaning
A easy eay for avoid that a larger polygon is over a small one could be based on z-index
assignin z-index with higher value to the polygon over the others eg:
// the larger - at base
var polylgon1 = new google.maps.Polygon({
...
zIndex: 100
});
// the middle - at medium leve
var polylgon2 = new google.maps.Polygon({
...
zIndex: 200
});
// the smaller - at top leve
var polylgon3= new google.maps.Polygon({
...
zIndex: 300
});
Related
I'm looking to highlight the Arctic circle latitude in an amcharts5 globe
Take this demo:
https://codepen.io/juliusuk/pen/zYaEmbL
the "create graticule series" commented part makes the grid of longitudes and latitudes (see https://www.amcharts.com/docs/v5/charts/map-chart/graticule-series/)
// Create graticule series
// https://www.amcharts.com/docs/v5/charts/map-chart/graticule-series/
var graticuleSeries = chart.series.push(am5map.GraticuleSeries.new(root, {}));
graticuleSeries.mapLines.template.setAll({ strokeOpacity: 0.1, stroke: root.interfaceColors.get("alternativeBackground") })
I would like to add a single graticule at 66.34 latitude that is e.g black and thicker than the rest of the stroke. Maybe even add a annotation or tooltip for it. Is this possible?
There is the map line function, but it only takes a geoJSON LineString, points with lines drawn straight between them: https://www.amcharts.com/docs/v5/charts/map-chart/map-line-series/, which wont result in them staying around a latitude
Can separate styling of a latitude (e.g. 66.34) be done either by:
• Highlighting a single graticule with the graticuleSeries feature of amcharts5?
• somehow in geoJSON? In that case MapLineSeries can be used
I have multiple map views and each view has a group of map markers
e.g. Map View 1 = 4 map markers, Map View 2 = 10 map markers, Map View 3 = 20 map markers.
In most instances the map markers are a few meters from each other and in other instances they are a few miles apart.
Is there an easy way to set the Map View such that it automatically zooms in such that it encompasses the map markers in each view. If i have to do it manually no amount of zoom level will never be perfect.
An alternative is to define a center and a custom zoom level for each map view but that sounds a bit tedious.
There is no automatic function for doing this - you can calculate the bounding box corresponding to the POI cluster (i.e. find the top left lat and long and bottom right lat and long) and zoom to that bounding box.
Is it possible to make the symbolizer of a feature be a polygon?
Openlayers 3 has a ol.style.Circle and ol.style.RegularShape symbolizers for example. Is there something equivalent to a hypothetical ol.style.Polygon? Whereby you could make a dynamic symbolizer from multiple points?
The reason I want to do this is because I have markers on my map that are dynamically shaped depending on the data for that marker. It is possible to simply draw a ol.geom.Polygon at each point, but then they are not zoom independent. I want to have markers that are zoom independent, meaning that their size on the screen does not change when I zoom in or out.
And just to be clear, using raster images (for example in ol.style.Icon) is not possible. There are way too many markers in way too many shapes and colours in my project.
Yes, this is possible. ol.style.Style takes a geometry argument that you can use to overwrite the geometry that is used to render a feature.
var style = function(feature, resolution) {
// construct the polygon taking the resolution into account
var polygon = new ol.geom.Polygon(...);
return [
new ol.style.Style({
geometry: polygon,
stroke: ...
fill: ...
}),
];
};
Also see this question: Drawing a Speed Leader line in OpenLayers
Is there a way to get Mapbox.js tooltips to show when you're hovering over a marker without following the mouse around? I just want it to stay put when I hover.
I am using the following code on my map:
var map = L.map("impact-map")
.setView([20, 80], 3)
.addLayer(L.mapbox.tileLayer("hotchkissmade.in_impact", {
detectRetina: true
}));
var myGridLayer = L.mapbox.gridLayer('hotchkissmade.in_impact').addTo( map );
var myGridControl = L.mapbox.gridControl(myGridLayer, {
follow: true
}).addTo( map );
I am using the follow:true from the example here.
Disclaimer: I know there may be more flexibility outside of gridControl but I like having my tooltips from Tilemill as I don't want to load the data in the browser twice, since I'm basing the tooltip data off the layer making the markers on my map in Tilemill
This isn't possible with a gridControl - you can have tooltips either follow the mouse or stay in a specific location, but unlike L.mapbox.featureLayer, there is no actual marker, polygon, or feature you're hovering over - the geometry is not pushed to the client - so, there would be no 'anchor' for the tooltip to stay on.
I have a fusion table which combines markers and polygons. Sometimes the markers are layered below a polygon and are unclickable. Is there a way to force a marker to appear ABOVE the polygon, so both are clickable?
Example table ID: 3821195
Location is Toronto, Canada. If you zoom in tight, the marker is buried below the polygon.
I've experimented with creating different tables, entering the marker first, or entering the polygon first, but in some cases (eg the table above) the marker is alway underneath the polygon. How come, and how to solve?
Thanks,
Wendy
In the end I put the polygons in one table and the markers in another, and then stacked the layers with the polygon layer on the bottom.
This is the part of the script where the order of the layers were set:
layer1.setMap(map);
layer2.setMap(map);
layer4.setMap(map);
layer3.setMap(map);
First one listed is on the bottom. Last one listed is on the top.
Hope this helps somebody else.