私は次のことを試みています:<\/P>
ボタンをクリックすると、国またはハイライトされた国のセットが表示されます。<\/P>
次に、国をクリックすると、ハイライトされた都市または複数の都市にズームインします。<\/P>
<\/P>
ズームインしたときに都市をクリック可能なレイヤーとして表示したいです。<\/P>
現在、ハイライトされた国をクリックしてズームインすると、都市は点のように見えます.. (ICGC WEB PORTAL<\/A> )<\/SPAN><\/P> <\/P>ご提案があればぜひお聞かせください!!<\/P> <\/P>クリス<\/P>
the click event for your cityLayer isn't triggered because you're adding it to the map before (and therefore underneath) the countries.
I want to display the city/cities as a clickable layer
what is a 'clickable layer'?
the city looks like a dot
what do you expect the cities to look like?
you'll have to be a lot more specific about what exactly what you're trying to accomplish and what you've already tried in order for someone to be able to help you.
By clickable I mean when you click on the city, data about the city will be
displayed in the side panel
So here is what I am trying to make happen:
Step 1, Click on the country and zoom into and center on the city.
Step 2. Click on the city and data about the city is displayed in the side
panel
I defined a city url:
var cityURL = 'http://....../StRaphaelOSM/MapServer/;
and added the following code
var cityLayer = L.esri.featureLayer().addTo(map);
cityLayer.on('click', function(evt) {
var bounds = evt.layer.getBounds()
map.fitBounds(bounds);
});
John:
Thanks for pointing that out!!
Problem solved!!
Chris
ログインすると、投稿したり、更新をフォローしたりできます。初めてですか?無料アカウントを登録しましょう。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.